Bug 91988 - cannot get gdb to stop at breakpoint in child thread
Summary: cannot get gdb to stop at breakpoint in child thread
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnston
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-30 18:02 UTC by Ken Savela
Modified: 2015-01-08 00:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-08-25 18:39:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Ken Savela 2003-05-30 18:02:25 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208
Netscape/7.02

Description of problem:
I'll set a breakpoint in a C++ class method that is called on a thread other
than the process's original thread.  When the app is then "run", a 

    Program received signal SIGTRAP, Trace/breakpoint trap.

is displayed by gdb and a "where" indicates that the location -- not the
requested one but another location altogether -- at which the app stopped is
part of the main thread, not the child thread.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
see the additional information below...
    

Additional info:

[eoops@ksavela4 Z_prodsim_2]$ dbg
GNU gdb Red Hat Linux (5.2.1-4)

<snip...>

This GDB was configured as "i386-redhat-linux"...
(gdb) break FileWriter::ProcessPulse
Breakpoint 1 at 0x8072c43: file filewriter.cc, line 326.
(gdb) run
Starting program: /home/ots/version/sysapps/prodsim/DEV/prodsim 
PRODSIM - version 2.0.0

   <snip...>

Thread AUDITLOG (16387) started
Thread AUDITLOG.emitter (24580) started

Program received signal SIGTRAP, Trace/breakpoint trap.
TagValueGen::create(Str const&, Str const&, Str const&, TVMsg const*) (
    uname=@0x82d0288, cls=@0xbfffe780, instance=@0xbfffe770, cfg=0x8c58dc0)
    at tv_gen.cc:223
223     {
(gdb) where
#0  TagValueGen::create(Str const&, Str const&, Str const&, TVMsg const*) (
    uname=@0x82d0288, cls=@0xbfffe780, instance=@0xbfffe770, cfg=0x8c58dc0)
    at tv_gen.cc:223
#1  0x08097ea3 in ComponentManager::createStreamHeads(Str const&, DbHandler*) (
    this=0xbffff2bc, clientId=@0x82d0288, dbh=0xbfffe9e0) at compmgr.cc:55
#2  0x0809987e in ComponentManager::load(Str const&, DbHandler*) (
    this=0xbffff2bc, clientId=@0x82d0288, dbh=0xbfffe9e0) at compmgr.cc:194
#3  0x080670bd in SysCtl::init(int, char**) (this=0xbffff2b0, ac=1, 
    av=0xbffff544) at ctl.cc:115
#4  0x080516a6 in main (ac=1, av=0xbffff544) at prodsim.cc:110
#5  0x081b94c2 in __libc_start_main ()

Comment 1 John Slaby 2003-06-06 18:30:51 UTC
I am finding the same problem with RH 9.0. I pulled down the latest gdb and 
rebuilt it with no success. I have run gdb under both KDevelop and stand-alone 
with the same results. In addition to the SIGTRAP not stopping at a breakpoint, 
I have also seen SIGSEGV errors (my bugs) that are not trapped by the debugger -
 they simply cause the app to abort. The debugger thinks it is still running. 
When I reworked my source to eliminate the threads, everything works fine.

Comment 2 Jeff Johnston 2003-08-22 19:17:05 UTC
Does the problem still occur with latest rpms installed
(kernel, glibc, gdb specifically)?

Comment 3 John Slaby 2003-08-23 15:13:19 UTC
I was able to correct the problem with RH 9.0 by reinstalling gdb. 

Comment 4 Jeff Johnston 2003-08-25 18:39:48 UTC
Thanks for the confirmation.  I am closing the bug.


Note You need to log in before you can comment on or make changes to this bug.