gdbserver/Linux: internal error when killing a process that is already gone
authorPedro Alves <palves@redhat.com>
Tue, 14 Jul 2015 09:10:50 +0000 (10:10 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 14 Jul 2015 09:10:50 +0000 (10:10 +0100)
commit586b02a96f744497c8921a558f1c386287849ab0
treeed317d05b0d418b728f900dd089ae01c0cf74698
parent05e83eb1b6a69c34b2fc5ab5e2dc14119145e49d
gdbserver/Linux: internal error when killing a process that is already gone

If the process disappears (e.g., killed with "kill -9" from the shell)
while it was stopped under GDBserver's control, and the GDBserver
tries to kill it, GDBserver asserts:

 (gdb) shell kill -9 23084
 (gdb) kill
 ...
 Killing process(es): 23084
 /home/pedro/gdb/mygit/src/gdb/gdbserver/linux-low.c:972: A problem internal to GDBserver has been detected.
 kill_wait_lwp: Assertion `res > 0' failed.
 ...

gdb/gdbserver/ChangeLog:
2015-07-14  Pedro Alves  <palves@redhat.com>

* linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
Instead, ignore ECHILD, and throw an error for other errnos.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c