public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "marc.khouzam at ericsson dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/17012] New: Detaching from process with call-style dprintf crashes the inferior
Date: Tue, 03 Jun 2014 18:23:00 -0000	[thread overview]
Message-ID: <bug-17012-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2014-06-03 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 18:23 marc.khouzam at ericsson dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17012-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).