This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

threads/2358: Program terminated with signal SIGTRAP, Trace/breakpoint trap


>Number:         2358
>Category:       threads
>Synopsis:       Program terminated with signal SIGTRAP, Trace/breakpoint trap
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 08 10:38:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Mihai stanescu
>Release:        > gdb 6.6
>Organization:
>Environment:
Gentoo distribution, all patches,kernel 2.6.22-gentoo-r8, also happens with newer kernels

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
>Description:
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.

I am using NPTL 
>How-To-Repeat:
Just compile the program with
gcc -g -o pthreadtest pthreadtest.c -lpthreads

run program with 
./pthreadtest  &

gdb -p `pgrep pthreadtest`

In gdb

br 12
continue

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="pthreadtest.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="pthreadtest.c"

I2luY2x1ZGUgPHB0aHJlYWQuaD4KI2luY2x1ZGUgPHNjaGVkLmg+CiNpbmNsdWRlIDxzdGRpby5o
PgojaW5jbHVkZSA8dW5pc3RkLmg+CgoKdm9pZCoKbXlUaHJlYWQodm9pZCogYXJnKQp7CiAgICB3
aGlsZSgxKSB7CiAgICAgICAgc2xlZXAoNSk7CiAgICAgICAgcHJpbnRmKCJTdWNjZXNzLCBjcmVh
dGVkIHRocmVhZCBleGl0aW5nXG4iKTsKICAgIH0KICAgIHJldHVybiAoMCk7Cn0KCgppbnQKbWFp
bihpbnQgYXJnYywKICAgIGNoYXIqKiBhcmd2KQp7CgoKaW50IHByaW9yaXR5ID0gIDEwOwppbnQg
c3RhdHVzOwpwdGhyZWFkX3QgdGhyZWFkSWQ7CgoKcHJpbnRmKCJXaWxsIGNyZWF0ZSB0aHJlYWQg
d2l0aCBwcmlvcml0eSAlZFxuIiwgcHJpb3JpdHkpOwpzdGF0dXMgPSBwdGhyZWFkX2NyZWF0ZSgm
dGhyZWFkSWQsIE5VTEwsIG15VGhyZWFkLCAwKTsKcHJpbnRmKCJUaHJlYWQgY3JlYXRpb24gcmV0
dXJuZWQgJWRcbiIsIHN0YXR1cyk7Cgp2b2lkICp2YWx1ZTsKcHRocmVhZF9qb2luKHRocmVhZElk
LCAmdmFsdWUpOwoKcHJpbnRmKCJNYWluIHRocmVhZCBleGl0aW5nXG4iKTsKICAgcmV0dXJuICgw
KTsKfQo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]