[Bug nptl/5983] New: Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
jan dot kratochvil at redhat dot com
sourceware-bugzilla@sourceware.org
Tue Mar 25 14:23:00 GMT 2008
The child of FORK becomes (later) singlethreaded, unfortunately it gets caught
too early by PTRACE_O_TRACEFORK and the child appears as multithreaded to
nptl_db that time.
gcc -ggdb3 -Wall -Werror -o forktest forktest.c -lthread_db -ldw -lelf -lebl
-ldl -pthread
outputs:
child = 9097
LWP = 9097 TID = 0x2aaaaace9290
LWP = 9098 TID = 0x40a00950
child2 = 9099
LWP = 9099 TID = 0x2aaaaace9290
LWP = 9098 TID = 0x40a00950 <- stale thread
while it should be:
child = 9097
LWP = 9097 TID = 0x2aaaaace9290
LWP = 9098 TID = 0x40a00950
child2 = 9099
LWP = 9099 TID = 0x2aaaaace9290
Untested glibc fix attached but just the part modifying `nptl_db/structs.def'
completely breaks nptl_db for me.
This patch variant has some performance hit calling __getpid(), the other way
would require adding some new field to `struct pthread'.
Going to fix it myself but still did not find enough time so at least making the
problem public.
--
Summary: Stale threads from TD_TA_THR_ITER of the FORK child
during PTRACE_SYSCALL
Product: glibc
Version: unspecified
Status: NEW
Severity: minor
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: jan dot kratochvil at redhat dot com
CC: glibc-bugs at sources dot redhat dot com
GCC host triplet: x86_64-unknown-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=5983
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Glibc-bugs
mailing list