public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/17012] New: Detaching from process with call-style dprintf crashes the inferior
@ 2014-06-03 18:23 marc.khouzam at ericsson dot com
  2014-06-12 16:57 ` [Bug breakpoints/17012] " simon.marchi at ericsson dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marc.khouzam at ericsson dot com @ 2014-06-03 18:23 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17012

            Bug ID: 17012
           Summary: Detaching from process with call-style dprintf crashes
                    the inferior
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: marc.khouzam at ericsson dot com
                CC: simon.marchi at ericsson dot com

If I set a call-style dprintf on an inferior and then detach from that
inferior, the inferior crashes.  It looks like the dprintf is not removed when
detaching.

If I do this after attaching to the inferior I see this printout with it
crashes:

Trace/BPT trap (core dumped)

Below is a session starting a process, setting the call-style dprintf and then
detaching, which causes the crash:

> gdb.7.7 ~/testing/loopfirst
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/lmckhou/testing/loopfirst...done.
(gdb) l
1       #include <unistd.h>
2       #include <stdio.h>
3
4       int main() {
5           int max = 900;
6           for (int i=0;i<max;i++) {
7               printf("i is %d\n",i);
8               sleep(1);
9           }
10          return 0;
(gdb) set non-stop on
(gdb) set pagination off
(gdb) set target-async on
(gdb) set dprintf-style call
(gdb) dprintf 7,"h\n"
Dprintf 1 at 0x40055c: file loopfirst.cc, line 7.
(gdb) start
Temporary breakpoint 2 at 0x40054c: file loopfirst.cc, line 5.
Starting program: /home/lmckhou/testing/loopfirst 

Temporary breakpoint 2, main () at loopfirst.cc:5
5           int max = 900;
(gdb) detach
Detaching from program: /home/lmckhou/testing/loopfirst, process 305
(gdb) shell ps -ef|grep 305
lmckhou    305 32765  0 14:15 pts/2    00:00:00 [loopfirst] <defunct>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-25  0:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-03 18:23 [Bug breakpoints/17012] New: Detaching from process with call-style dprintf crashes the inferior marc.khouzam at ericsson dot com
2014-06-12 16:57 ` [Bug breakpoints/17012] " simon.marchi at ericsson dot com
2014-12-10 21:14 ` cvs-commit at gcc dot gnu.org
2014-12-10 21:16 ` simon.marchi at ericsson dot com
2014-12-17 14:42 ` marc.khouzam at ericsson dot com
2014-12-17 14:47 ` simon.marchi at ericsson dot com
2014-12-25  0:46 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).