From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130601 invoked by alias); 25 Oct 2015 14:46:39 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 130589 invoked by uid 89); 25 Oct 2015 14:46:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 25 Oct 2015 14:46:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C22D88E3E7; Sun, 25 Oct 2015 14:46:36 +0000 (UTC) Received: from tranklukator.brq.redhat.com (dhcp-1-102.brq.redhat.com [10.34.1.102]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t9PEkVoZ004600; Sun, 25 Oct 2015 10:46:32 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Sun, 25 Oct 2015 16:43:01 +0100 (CET) Date: Sun, 25 Oct 2015 14:46:00 -0000 From: Oleg Nesterov To: Pedro Alves Cc: Andrew Morton , Dmitry Vyukov , Alexander Potapenko , Denys Vlasenko , Eric Dumazet , Jan Kratochvil , Julien Tinnes , Kees Cook , Kostya Serebryany , Linus Torvalds , "Michael Kerrisk (man-pages)" , Robert Swiecki , Roland McGrath , syzkaller@googlegroups.com, linux-kernel@vger.kernel.org, "gdb@sourceware.org" Subject: Re: [PATCH 0/2] wait/ptrace: always assume __WALL if the child is traced Message-ID: <20151025154256.GA2043@redhat.com> References: <20151020171740.GA29290@redhat.com> <5628F569.4070602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5628F569.4070602@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2015-10/txt/msg00098.txt.bz2 On 10/22, Pedro Alves wrote: > > In any case, to make sure existing gdb binaries would still work > with your kernel change, I ran GDB's testsuite with this: > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c > index cbcdd95..864ba2e 100644 > --- a/gdb/nat/linux-waitpid.c > +++ b/gdb/nat/linux-waitpid.c > @@ -149,3 +149,17 @@ my_waitpid (int pid, int *status, int flags) > errno = out_errno; > return ret; > } > + > +#include > + > +pid_t > +waitpid (pid_t pid, int *status, int options) > +{ > + static pid_t (*waitpid2) (pid_t pid, int *status, int options) = NULL; > + > + if (waitpid2 == NULL) > + waitpid2 = dlsym (RTLD_NEXT, "waitpid"); > + > + options |= __WALL; > + return waitpid2 (pid, status, options); > +} > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks a lot Pedro! So gdb should be fine, strace too. Perhaps we should change the kernel this way and forget about /sbin/init fixes. Oleg.