This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb and linuxthreads (A deadlock in linuxthreads.)


> 
> > I have verified that there was no third thread at all. There were only
> > 2 threads, the manager and the thread just sent a request to the
> > manager. It may be a race condition which can only happen on a SMP
> > machine.
> 
> Hmph.  That's interesting.  I'll try to think of a scenario that
> explains this.  Sometimes, I fear the memory subsystem doesn't
> implement strong ordering on memory accesses like it's supposed to do
> according to the docs...
> 
> At any rate, you'll find below the patches that change the signal used
> to report dead children.  The patches are against the current working
> sources on anoncvs@glibc.cygnus.com.  I haven't been able to test them
> on my home machine, but will test them tomorrow at work.  I'll also
> test what happens with gdb.  Maybe the extra signals don't break
> anything, just causing gdb to rescan the set of running threads
> unnecessarily.
> 

It does't work on my SMP machine. Both ex1 and ex3 failed:

# ps
..
10733  p1 T    0:00 /home/work/gnu/bin/glibc/elf/ld-linux.so.2 --library-path
/h
10737  p1 T    0:00 /home/work/gnu/bin/glibc/elf/ld-linux.so.2 --library-path
/h
10744  p1 Z    0:00 (ld-linux.so.2 <zombie>)
10747  p1 Z    0:00 (ld-linux.so.2 <zombie>)
..
# gdb ex1
(gdb) att 10733
Attaching to program `/home/work/gnu/bin/glibc/linuxthreads/ex1', Pid 10733
Reading symbols from /home/work/gnu/bin/glibc/linuxthreads/libpthread.so.0...
done.
Reading symbols from /home/work/gnu/bin/glibc/libc.so.6...done.
"/": not in executable format: Is a directory.
(gdb) bt
#0  0x4002e8ce in __sigsuspend (set=0xbffff138)
    at ../sysdeps/unix/sysv/linux/sigsuspend.c:48
#1  0x40007433 in pthread_exit_process (retcode=0, arg=0x0) at restart.h:32
#2  0x40030c6a in exit (status=0) at exit.c:52
#3  0x40028851 in __libc_start_main () at ../sysdeps/generic/libc-start.c:78
# gdb ex3
(gdb) att 10737
Attaching to program `/home/work/gnu/bin/glibc/linuxthreads/ex3', Pid 10737
Reading symbols from /home/work/gnu/bin/glibc/linuxthreads/libpthread.so.0...
done.
Reading symbols from /home/work/gnu/bin/glibc/libc.so.6...done.
"/": not in executable format: Is a directory.
(gdb) bt
#0  0x4002e8ce in __sigsuspend (set=0xbffff138)
    at ../sysdeps/unix/sysv/linux/sigsuspend.c:48
#1  0x40007433 in pthread_exit_process (retcode=0, arg=0x0) at restart.h:32
#2  0x40030c6a in exit (status=0) at exit.c:52
#3  0x40028851 in __libc_start_main () at ../sysdeps/generic/libc-start.c:78

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]