From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934742AbbKSSqY (ORCPT ); Thu, 19 Nov 2015 13:46:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43321 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934030AbbKSSqW (ORCPT ); Thu, 19 Nov 2015 13:46:22 -0500 Date: Thu, 19 Nov 2015 19:47:09 +0100 From: Oleg Nesterov To: Andrew Morton , Andrey Ryabinin Cc: Roland McGrath , Tejun Heo , LKML , Pedro Alves , Jan Kratochvil Subject: [PATCH 0/2] (Was: ptrace() hangs on attempt to seize/attach stopped & frozen task) Message-ID: <20151119184709.GA19061@redhat.com> References: <5640B7F2.70406@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5640B7F2.70406@virtuozzo.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09, Andrey Ryabinin wrote: > > So, the ptrace() hangs if we try to attach to stopped task from freezing cgroup. OK, lets make it killable at least, TASK_KILLABLE looks better in any case. I am starting to think again that we should remove JOBCTL_TRAPPING, but this needs a bit more discussion and probably testing. Anyway I agree with Tejun, the freezer doesn't look nice too. Hmm. I need to re-check but it seems we have another problem... ptrace_stop() does task_participate_group_stop() and this (in particular) clears JOBCTL_STOP_PENDING. This is only correct if the task is still traced, but this is not necessarily true and we can in fact clear JOBCTL_STOP_PENDING set by __ptrace_unlink() called by the exiting tracer. Oleg.