public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/5983] New: Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
@ 2008-03-25 14:23 jan dot kratochvil at redhat dot com
  2008-03-25 14:24 ` [Bug nptl/5983] " jan dot kratochvil at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-03-25 14:23 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-5983-131@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2014-07-01 21:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-25 14:23 [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
2008-03-25 14:24 ` [Bug nptl/5983] " jan dot kratochvil at redhat dot com
2008-03-25 14:26 ` jan dot kratochvil at redhat dot com
2008-03-25 14:27 ` jan dot kratochvil at redhat dot com
2008-03-26  0:18 ` roland at gnu dot org
2008-03-26  8:39 ` roland at gnu dot org
2008-03-30 22:36 ` jan dot kratochvil at redhat dot com
     [not found] <bug-5983-131@http.sourceware.org/bugzilla/>
2014-07-01 21:18 ` fweimer at redhat dot com

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).