Bug 17241 - reconnecting after crashed gdbserver: breakpoints don't work, inferior segvs
Summary: reconnecting after crashed gdbserver: breakpoints don't work, inferior segvs
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-07 18:31 UTC by dje
Modified: 2014-08-07 18:31 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dje 2014-08-07 18:31:24 UTC
Playing with PR 17239 some more, I found "start" would run past "main" after I restart gdbserver and reconnect, and the inferior gets a SEGV.

bash1$ ./gdbserver --multi :1234
Listening on port 1234
Remote debugging from host 127.0.0.1
Process /home/dje/hello.x64  created; pid = 17378
Cannot exec /home/dje/hello.x64 : No such file or directory.

Child exited with status 127
Process /home/dje/hello.x64 created; pid = 17426
gdbserver: no target description

[start gdbserver again after it errantly exits]

bash1$ ./gdbserver --multi :1234
Listening on port 1234
Remote debugging from host 127.0.0.1
Process /home/dje/hello.x64 created; pid = 17450
Hello. <<<< bkpt at main not hit or gdbserver loses control?

And in a second shell,

bash2$ make run
(gdb) tar ext :1234
Remote debugging using :1234
(gdb) file ~/hello.x64
Reading symbols from ~/hello.x64...done.
(gdb) set remote exec-file /home/dje/hello.x64<space>
(gdb) start
Temporary breakpoint 1 at 0x4006d8: file hello.cc, line 6.
Starting program: /usr/local/google/home/dje/hello.x64
Running "/home/dje/hello.x64 " on the remote target failed
(gdb) set remote exec-file /home/dje/hello.x64
(gdb) start
Temporary breakpoint 2 at 0x4006d8: file hello.cc, line 6.
Starting program: /usr/local/google/home/dje/hello.x64
Remote connection closed

[go back to bash1 at this point and restart gdbserver, see above]

(gdb) pwd
Working directory /foo/build/obj64/gdb.
(gdb) show remote exec-file
The remote pathname for "run" is "/home/dje/hello.x64".
(gdb) tar ext :1234
Remote debugging using :1234
(gdb) start
Temporary breakpoint 3 at 0x4006d8: file hello.cc, line 6.
Starting program: /usr/local/google/home/dje/hello.x64

Program received signal SIGSEGV, Segmentation fault.
0x000000000000000b in ?? ()
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     del  y   0x00000000004006d4 in main() at hello.cc:5
2       breakpoint     del  y   0x00000000004006d4 in main() at hello.cc:5
3       breakpoint     del  y   0x00000000004006d4 in main() at hello.cc:5