From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18924 invoked by alias); 25 Oct 2011 19:34:13 -0000 Received: (qmail 18764 invoked by uid 22791); 25 Oct 2011 19:34:12 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 19:33:58 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RIml3-0002Vd-Eu from pedro_alves@mentor.com ; Tue, 25 Oct 2011 12:33:57 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 25 Oct 2011 20:33:55 +0100 From: Pedro Alves To: Oleg Nesterov Subject: Re: FYI: fix 2 tests when glibc debuginfo is installed Date: Tue, 25 Oct 2011 19:50:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Jan Kratochvil , gdb-patches@sourceware.org, Tom Tromey References: <201110251912.26857.pedro@codesourcery.com> <20111025183022.GA25438@redhat.com> In-Reply-To: <20111025183022.GA25438@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110252033.51826.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00677.txt.bz2 On Tuesday 25 October 2011 19:30:22, Oleg Nesterov wrote: > On 10/25, Pedro Alves wrote: > > > > On Tuesday 25 October 2011 18:32:49, Oleg Nesterov wrote: > > > But, compared to the old kernels, the tracee "remembers" the > > > fact it was stopped, and it will stop again after DETACH. Unless SIGCONT > > > in between. > > > > What about PTRACE_CONT in between (no SIGCONT)? Does it make the > > kernel "forget" the fact that the child was stopped before? > > No, Ah, cool. > > If not, what happens if the ptracer dies while its child > > is PTRACE_CONT'ed, and the child was stopped at PTRACE_ATTACH time? > > This doesn't differ from the explicit PTRACE_DETACH. > > Actually, this is very simple. We have the per-process (_not_ > per thread/tracee) flag, SIGNAL_STOP_STOPPED. It means that this > thread group is stopped (OK, it is not that simple, but we can ignore > details). ptrace can never set/clear this flag. In particular it > is still set after PTRACE_CONT or whatever resumes the tracee. > Only SIGCONT clears SIGNAL_STOP_STOPPED. > > Now, __ptrace_unlink() (called by PTRACE_DETACH or by the dying > tracee) checks SIGNAL_STOP_STOPPED, if it is set we ask the tracee > to stop again. Thanks! All makes sense now. -- Pedro Alves