Bug 9463 - Program terminated with signal SIGTRAP, Trace/breakpoint trap
Summary: Program terminated with signal SIGTRAP, Trace/breakpoint trap
Status: RESOLVED DUPLICATE of bug 9426
Alias: None
Product: gdb
Classification: Unclassified
Component: threads (show other bugs)
Version: 6.6
: P1 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 22297 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-08 10:38 UTC by mihai stanescu
Modified: 2017-10-17 19:18 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
pthreadtest.c (296 bytes, application/octet-stream)
, 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 10:38:01 UTC
[Converted from Gnats 2358]

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

Release:
> gdb 6.6

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

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
Comment 1 drow@false.org 2007-11-08 13:01:25 UTC
From: Daniel Jacobowitz <drow@false.org>
To: mihai.stanescu@gmail.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: threads/2358: Program terminated with signal SIGTRAP,
	Trace/breakpoint trap
Date: Thu, 8 Nov 2007 08:01:25 -0500

 On Thu, Nov 08, 2007 at 10:30:30AM -0000, mihai.stanescu@gmail.com wrote:
 > 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.
 
 This is the same as PR threads/2321.  I think something must be wrong
 with Gentoo's latest glibc; it does not happen on any other system.
 
 -- 
 Daniel Jacobowitz
 CodeSourcery
Comment 2 Pedro Alves 2017-10-17 19:15:43 UTC
*** Bug 22297 has been marked as a duplicate of this bug. ***
Comment 3 Pedro Alves 2017-10-17 19:18:14 UTC
>  This is the same as PR threads/2321.  I think something must be wrong
>  with Gentoo's latest glibc; it does not happen on any other system.
>  

Marking as dup then.
Comment 4 Pedro Alves 2017-10-17 19:18:45 UTC
Really marking as dup.

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