public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "ggs334 at 163 dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/13333] In some case,when remote target is disconnectted,but GDB try to delete breakpoints by send z0 packet, it will cause GDB crash
Date: Sun, 23 Oct 2011 08:56:00 -0000	[thread overview]
Message-ID: <bug-13333-4717-nuAhs87Dd6@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-13333-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=13333

gaohusheng <ggs334 at 163 dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |X86-linux
               Host|                            |X86-linux
   Target Milestone|---                         |7.1
            Summary|In some case,when remote    |In some case,when remote
                   |target is disconnectted,but |target is disconnectted,but
                   |GDB                         |GDB try to delete
                   |                            |breakpoints by send z0
                   |                            |packet, it will cause GDB
                   |                            |crash

--- Comment #1 from gaohusheng <ggs334 at 163 dot com> 2011-10-23 08:55:47 UTC ---
In some case,when remote target is disconnectted,but GDB try to delete
breakpoints by send z0 packet, it will cause GDB crash

===========my test case================

<stdio.h>

int main()

{

 int j=0;

 j++;

 j++;

 j++;

 j++;

 j++;

 j++;

 j++;

 j++;

 return 0;

}


I test this case on:
host: x86-linux GDB;
target x86-linux GDBserver;

[guosheng_gao@rslpc1 nat-7.3]$ bin/gdb

GNU gdb (GDB) 7.3.1

Copyright (C) 2011 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 "i686-pc-linux-gnu".

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>.

(gdb) file ~/test/gao2

Reading symbols from /home/guosheng_gao/test/gao2...done.

(gdb) b main

Breakpoint 1 at 0x8048340: file gao2.c, line 4.

(gdb) target remote :1234

Remote debugging using :1234

Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.

Loaded symbols for /lib/ld-linux.so.2

0x005197c0 in _start () from /lib/ld-linux.so.2

(gdb) c

Continuing.



Breakpoint 1, main () at gao2.c:4

4        int j=0;

(gdb) n

5        j++;

(gdb)

6        j++;

(gdb)

7        j++;

(gdb)

8        j++;

(gdb)

9        j++;

(gdb)

10       j++;

(gdb)

11       j++;

(gdb)

12       j++;

(gdb)

13       return 0;

(gdb) set debug remote 1

(gdb) n

(gdb) n
14      }
(gdb) n

(gdb) n

Single stepping until exit from function __libc_start_main,

which has no line number information.
...........................
==============I have omit some packet information=========
...........................

Sending packet: $vCont;c#a8...Packet received: W00


=================why this happen? ==================
[Inferior 1 (Remote target) exited normally]

Sending packet: $z0,529bd0,1#c9...Segmentation fault (core dumped)
=================why this happen? ==================


[guosheng_gao@rslpc1 nat-7.3]$

[guosheng_gao@rslpc1 nat-7.3]$ [Inferior 1 (Remote target) exited normally]

Badly placed ()'s.

[guosheng_gao@rslpc1 nat-7.3]$ Sending packet: $z0,529bd0,1#c9...Segmentation
fa                                              ult (core dumped)

Badly placed ()'s.

==============GDB server===============

GDBserver:
[guosheng_gao@rslpc1 nat-7.3]$ bin/gdbserver :1234 ~/test/gao2

Process /home/guosheng_gao/test/gao2 created; pid = 3182

Listening on port 1234

Remote debugging from host 127.0.0.1



Child exited with status 0

GDBserver exiting

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  reply	other threads:[~2011-10-23  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-23  8:39 [Bug gdb/13333] New: In some case,when remote target is disconnectted,but GDB ggs334 at 163 dot com
2011-10-23  8:56 ` ggs334 at 163 dot com [this message]
2011-10-25  2:27 ` [Bug gdb/13333] In some case,when remote target is disconnectted,but GDB try to delete breakpoints by send z0 packet, it will cause GDB crash ggs334 at 163 dot com

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-13333-4717-nuAhs87Dd6@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).