From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666AbbKISCN (ORCPT ); Mon, 9 Nov 2015 13:02:13 -0500 Received: from mail-yk0-f180.google.com ([209.85.160.180]:33008 "EHLO mail-yk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbbKISCL (ORCPT ); Mon, 9 Nov 2015 13:02:11 -0500 Date: Mon, 9 Nov 2015 13:02:07 -0500 From: Tejun Heo To: Oleg Nesterov Cc: Andrey Ryabinin , Roland McGrath , LKML Subject: Re: ptrace() hangs on attempt to seize/attach stopped & frozen task Message-ID: <20151109180207.GA28507@mtj.duckdns.org> References: <5640B7F2.70406@virtuozzo.com> <20151109185506.GA22744@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151109185506.GA22744@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Oleg. > Thanks. All I can say I never liked this wait_on_bit() ;) > > I need to think, but *at first glance* we can move this wait-for-stopped- > traced-transition into do_wait() path, and this way clear_jobctl_trapping() > can use __wake_up_parent(). Perhaps we just need to modify task_stopped_code() > to take JOBCTL_TRAPPING into account... > > Sure, debugger will block in sys_wait() after PTRACE_ATTACH/SEIZE. But this > does not really differ from the case when the tracee was already frozen; > SIGSTOP sent by ATTACH or PTRACE_INTERRUPT, so debugger will equally block > in do_wait() until the tracee is unfrozen. We simply need to reimplement cgroup freezer so that its userland visible state is well defined (most likely jobctl stop). Right now, it's allowing userland to trigger "stuck somewhere in the kernel" condition, so interactions with frozen tasks are naturally broken. Thanks. -- tejun