First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 198448
Alias:
Product:
Component:
Status: RESOLVED
Resolution: DUPLICATE of bug 196031
Assigned To: Gentoo Toolchain Maintainers <toolchain@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: mihai stanescu <mihai.stanescu@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
pthreadtest.c test program for bug text/plain mihai stanescu 2007-11-08 13:35 0000 575 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 198448 depends on: Show dependency tree
Bug 198448 blocks:
Votes: 20    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-11-08 13:34 0000
I have a simple program dynamically linked agains pthread.

When i try to set a breakpoint in a child thread created with pthread_create i
get

Program terminated with signal SIGTRAP, Trace/breakpoint trap.

Doenst happen on other non-gentoo distributions
Tried on 2 gentoo distributions and happens...there are already 2 bugs in gdb
bugzilla related to this

It looks like gdb doesnt stop on its own breakpoints if these are sent in child
pthreads

I have latest kernel

gcc (GCC) 4.1.2 (Gentoo 4.1.2)

---------------
GNU C Library stable release version 2.6.1, by Roland McGrath et al.
Compiled by GNU CC version 4.1.2 (Gentoo 4.1.2).
Compiled on a Linux >>2.6.22-gentoo-r8<< system on 2007-11-06.
Available extensions:
        C stubs add-on version 2.1.2
        crypt add-on version 2.1 by Michael Glad and others
        Gentoo patchset 1.1
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        Support for some architectures added on, not maintained in glibc core.
        BIND-8.2.3-T5B

Reproducible: Always

Steps to Reproduce:
1.gcc -g -o pthreadtest pthreadtest.c -lpthreads
2../pthreadtest  &
3.gdb -p `pgrep pthreadtest`
4.b 12
5. continue

wait a little...when SIGTRAP is issued the message in summary is displayed and
program is crushed



Expected Results:  
Stop at breakpoint and remain theere

------- Comment #1 From mihai stanescu 2007-11-08 13:35:11 0000 -------
Created an attachment (id=135487) [details]
test program for bug

------- Comment #2 From mihai stanescu 2007-11-08 13:36:03 0000 -------
seems to be related to the compilation of glibc 2.6.1

------- Comment #3 From mihai stanescu 2007-11-19 15:07:40 0000 -------
also happens if using intel debugger so its not a gcc problem

------- Comment #4 From mihai stanescu 2007-11-19 16:51:54 0000 -------
vanilla compilation of glibc 2.6.1 fixes the problem so its about the gentoo
patches

------- Comment #5 From mihai stanescu 2007-11-21 16:55:27 0000 -------
vanilla compilation fixes part of the problem

I realized now if i attach to the pthread process the problem still happens

gdb -p `pgrep pthreadtest`

------- Comment #6 From Nathan Caldwell 2007-11-22 21:58:17 0000 -------
Would you check the patch I posted at bug 196031, I think this is actually a
duplicate of that (and it may fix your problem ;). With it I get a proper
break.

------- Comment #7 From mihai stanescu 2007-11-28 10:38:24 0000 -------
Yes...avoid stripping of libpthread and libpthread_db and problem is gone

------- Comment #8 From SpanKY 2007-12-09 09:11:19 0000 -------

*** This bug has been marked as a duplicate of bug 196031 ***

First Last Prev Next    No search results available      Search page      Enter new bug