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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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 ` jan dot kratochvil at redhat dot com
  2008-03-25 14:26 ` jan dot kratochvil at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-03-25 14:24 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jan dot kratochvil at redhat dot com  2008-03-25 14:24 -------
Created an attachment (id=2336)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2336&action=view)
Testcase.

It is not a PASS/FAIL testcase suitable for glibc, it needs to become quiet +
evaluating its result.


-- 


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-03-25 14:26 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jan dot kratochvil at redhat dot com  2008-03-25 14:25 -------
Created an attachment (id=2337)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2337&action=view)
Possible broken fix.

Patch modifies `nptl_db/structs.def' breaking whole glibc nptl.


-- 


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-03-25 14:27 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jan dot kratochvil at redhat dot com  2008-03-25 14:27 -------
Problem verified only on Fedora 8 glibc-2.7-2.x86_64, IMO still exists in HEAD.


-- 


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 8+ messages in thread
From: roland at gnu dot org @ 2008-03-26  0:18 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper at redhat dot com   |roland at gnu dot org
             Status|NEW                         |ASSIGNED


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 8+ messages in thread
From: roland at gnu dot org @ 2008-03-26  8:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From roland at gnu dot org  2008-03-26 08:38 -------
If you mean you rebuilt your own libthread_db to use with a previously installed
libpthread, then that is not expected to work.  libpthread and libthread_db come
as a pair built from shared source, and you need a new libpthread build if you
add something to structs.def.

Note that due to elfutils bugs your test case doesn't always work on x86_64 when
libpthread is not prelinked.  To include a regression test in glibc, we can't
rely on elfutils libraries anyway.  It might not be practical to make a test
case for this that fits into the libc suite.

I've committed an nptl_db fix to the trunk that I think should cover it.

See http://koji.fedoraproject.org/scratch/roland/task_531585/ for F-8 glibc with
the patch.  (sudo sh /etc/cron.daily/prelink after rpm upgrade.)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
  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
                   ` (4 preceding siblings ...)
  2008-03-26  8:39 ` roland at gnu dot org
@ 2008-03-30 22:36 ` jan dot kratochvil at redhat dot com
  5 siblings, 0 replies; 8+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-03-30 22:36 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jan dot kratochvil at redhat dot com  2008-03-30 22:35 -------
Thanks, the Fedora 9 GDB has now automatically fixed its functionality/testcase:
    gdb.threads/watchpoint-fork.exp: child: multithreaded: *

Used for the testing the scratch build `glibc-2.7-2.bz5983.1'.

For the `forktest' testcase I had to use the prelinking workaround as
elfutils-0.133-2.fc8 does not seem to contain the fixes present present in MTN
"HEAD".  That elfutils bug was unfair. :-)  Also sure I forgot about PS_GETPID.

Closing as it is already comitted in the glibc CVS.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


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

* [Bug nptl/5983] Stale threads from TD_TA_THR_ITER of the FORK child during PTRACE_SYSCALL
       [not found] <bug-5983-131@http.sourceware.org/bugzilla/>
@ 2014-07-01 21:18 ` fweimer at redhat dot com
  0 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-07-01 21:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5983

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

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