public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	       Dmitry Vyukov <dvyukov@google.com>,
	       Alexander Potapenko <glider@google.com>,
	       Denys Vlasenko <dvlasenk@redhat.com>,
	       Eric Dumazet <edumazet@google.com>,
	       Jan Kratochvil <jan.kratochvil@redhat.com>,
	       Julien Tinnes <jln@google.com>,
	Kees Cook <keescook@google.com>,
	       Kostya Serebryany <kcc@google.com>,
	       Linus Torvalds <torvalds@linux-foundation.org>,
	       "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	       Robert Swiecki <swiecki@google.com>,
	       Roland McGrath <roland@hack.frob.com>,
	syzkaller@googlegroups.com,        linux-kernel@vger.kernel.org,
	       "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: [PATCH 0/2] wait/ptrace: always assume __WALL if the child is	traced
Date: Sun, 25 Oct 2015 14:46:00 -0000	[thread overview]
Message-ID: <20151025154256.GA2043@redhat.com> (raw)
In-Reply-To: <5628F569.4070602@redhat.com>

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 <dlfcn.h>
> +
> +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.

  reply	other threads:[~2015-10-25 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151020171740.GA29290@redhat.com>
2015-10-22 14:40 ` Pedro Alves
2015-10-25 14:46   ` Oleg Nesterov [this message]
     [not found] ` <20151020171754.GA29304@redhat.com>
     [not found]   ` <20151020153155.e03f4219da4014efe6f810b0@linux-foundation.org>
     [not found]     ` <5627EE9E.8040600@redhat.com>
     [not found]       ` <5627F607.4050506@redhat.com>
     [not found]         ` <20151021214703.GA1810@redhat.com>
     [not found]           ` <CAK1hOcP027FAWg5uVDjiFDC+0=dGu5JFJcy9Jij4dY8SBnT4MA@mail.gmail.com>
     [not found]             ` <20151025155440.GB2043@redhat.com>
2015-10-26 12:09               ` [PATCH 1/2] " Pedro Alves
2015-10-28 15:15                 ` Oleg Nesterov
2015-10-28 15:43                   ` Pedro Alves
2015-10-28 18:06                     ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151025154256.GA2043@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvlasenk@redhat.com \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=gdb@sourceware.org \
    --cc=glider@google.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=jln@google.com \
    --cc=kcc@google.com \
    --cc=keescook@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=palves@redhat.com \
    --cc=roland@hack.frob.com \
    --cc=swiecki@google.com \
    --cc=syzkaller@googlegroups.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).