Re: [PATCH RFA] lin-lwp.c: Block SIGCHLD events when attaching

Kevin Buettner
2001-11-20T00:42:47Z

On Nov 19, 11:38am, H . J . Lu wrote:

> On Mon, Nov 19, 2001 at 12:30:45PM -0700, Kevin Buettner wrote:
> > When doing a lin_lwp_attach_lwp(), it is sometimes possible to receive
> > a SIGCHLD signal thus causing the waitpid() call to fail with EINTR.
> > This in turn causes the second assert() in lin_lwp_attach_lwp() to
> > fail.
> >
> > Reproducing this problem can be somewhat difficult. I've only been
> > able to reproduce it on a dual processor Linux/x86 machine. I did
> > manage to reproduce it using the linux-dp program as follows:
> >
>
> Have you looked at
>
> http://sources.redhat.com/ml/gdb/2001-09/msg00139.html
>
> Specifically,
>
> # gcc -g ex11.c -lpthread -lrt -D_GNU_SOURCE -static
> # a.out
> # gdb a.out
> ...
> (gdb) att 14226
> Attaching to program: /home/hjl/bugs/gdb/thread/a.out, process 14226
> ...
> lin-lwp.c:620: gdb-internal-error: stop_wait_callback: Assertion `pid == GET_LWP (lp->ptid)' failed.
> An internal GDB error was detected. This may make further
>
> ex11.c is from glibc and 14226 is the first thread. Your patch may fix
> it also.

I think this might be a different problem. I haven't been able to
reproduce the exact problem that you mentioned above, either with
or without my patch.

I do occassionally see "Cannot find new threads: generic error". I'm
going to try to figure this one out...

Kevin