bugThe GNU Hurd - Bugs: bug #29642, gdb: breakpoints in triggered in...

 
 

bug #29642: gdb: breakpoints in triggered in other threads result in SIGTRAP

Submitter:  Carl Fredrik Hammar <hammy>
Submitted:  Thu 22 Apr 2010 02:38:30 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Reproducibility:  None
Size (loc):  None Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 

Sergey worked on the issue:

https://lists.gnu.org/archive/html/bug-hurd/2023-04/msg00003.html

* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 23 Apr 2010 09:21:05 AM UTC, comment #2: 

Yes, it is reproducible with cthreads.
In fact, I encountered the bug while debugging a cthreads program.
(I knew I forgot to mention something...)

I just now also confirmed that it is reproducible with a minimal example
to make sure it wasn't something particular to that program.

Carl Fredrik Hammar <hammy>
Group Member
Fri 23 Apr 2010 07:29:34 AM UTC, comment #1: 

Is this reproducable with the equivalent cthreads code?  It may well be that we have to teach GDB about pthreads.

Thomas Schwinge <tschwinge>
Group administrator
Thu 22 Apr 2010 02:38:30 PM UTC, original submission:  

When debugging a multithreaded program with gdb, breakpoints triggered in
separate threads results in a SIGTRAP as if it was a regular terminating
signal.  For instance, with the program:


#include <pthread.h>

void *
foo (void *arg)
{
  return NULL;
}

int
main (int argc, char *argv[])
{
  pthread_t t;

  pthread_create (&t, NULL, foo, NULL);
  pthread_join (t, NULL);
}



the bug can be like this:


(gdb) break main
Breakpoint 1 at 0x8048507: file /home/cfhammar/src/hurd-test/gdb-threads.c, line 14.
(gdb) break foo
Breakpoint 2 at 0x80484f7: file /home/cfhammar/src/hurd-test/gdb-threads.c, line 6.
(gdb) run
Starting program: /home/cfhammar/test/hurd-test/gdb-threads
[New Thread 423.5]

Breakpoint 1, main (argc=1, argv=0x15ffdc8)
    at /home/cfhammar/src/hurd-test/gdb-threads.c:14
14        pthread_create (&t, NULL, foo, NULL);
(gdb) continue
Continuing.
[New Thread 423.6]

Program received signal SIGTRAP, Trace/breakpoint trap.
0x01057d8c in mach_msg_trap ()
    at /home/buildd/build/chroot-unstable/home/buildd/byhand/eglibc-2.10.2/build-tree/hurd-i386-libc/mach/mach_msg_trap.S:2
2       /home/buildd/build/chroot-unstable/home/buildd/byhand/eglibc-2.10.2/build-tree/hurd-i386-libc/mach/mach_msg_trap.S: No such file or directory.
        in /home/buildd/build/chroot-unstable/home/buildd/byhand/eglibc-2.10.2/build-tree/hurd-i386-libc/mach/mach_msg_trap.S
Current language:  auto
The current source language is "auto; currently asm".



There are no problems when all the breakpoints are in main().  I have
only tested with gdb 7.0.1-2 from Debian.

Carl Fredrik Hammar <hammy>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sthibaul (Updated the item)
  • -email is unavailable- added by tschwinge (Posted a comment)
  • -email is unavailable- added by hammy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-04 sthibaul Wiki-like text discussion box Sergey worked on the issue: https://lists.gnu.org/archive/html/bug-hurd/2023-04/msg00003.html

    Back to the top

    Powered by Savane 3.13-ec04.
    Corresponding source code