Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 198448 - sys-devel/gdb6.6 + glibc 2.6.1 + pthreads=Program terminated with signal SIGTRAP, Trace/breakpoint trap
Summary: sys-devel/gdb6.6 + glibc 2.6.1 + pthreads=Program terminated with signal SIGT...
Status: RESOLVED DUPLICATE of bug 196031
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-08 13:34 UTC by mihai stanescu
Modified: 2007-12-09 09:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
test program for bug (pthreadtest.c,575 bytes, text/plain)
2007-11-08 13:35 UTC, mihai stanescu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mihai stanescu 2007-11-08 13:34:32 UTC
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 mihai stanescu 2007-11-08 13:35:11 UTC
Created attachment 135487 [details]
test program for bug
Comment 2 mihai stanescu 2007-11-08 13:36:03 UTC
seems to be related to the compilation of glibc 2.6.1
Comment 3 mihai stanescu 2007-11-19 15:07:40 UTC
also happens if using intel debugger so its not a gcc problem
Comment 4 mihai stanescu 2007-11-19 16:51:54 UTC
vanilla compilation of glibc 2.6.1 fixes the problem so its about the gentoo patches
Comment 5 mihai stanescu 2007-11-21 16:55:27 UTC
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 Nathan Caldwell 2007-11-22 21:58:17 UTC
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 mihai stanescu 2007-11-28 10:38:24 UTC
Yes...avoid stripping of libpthread and libpthread_db and problem is gone
Comment 8 SpanKY gentoo-dev 2007-12-09 09:11:19 UTC

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