• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂586b02a96f744497c8921a558f1c386287849ab0 (tree)
時間2015-07-14 18:10:50
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

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.

Change Summary

差異

--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
1+2015-07-14 Pedro Alves <palves@redhat.com>
2+
3+ * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
4+ Instead, ignore ECHILD, and throw an error for other errnos.
5+
16 2015-07-10 Pedro Alves <palves@redhat.com>
27
38 * event-loop.c (struct callback_event) <data>: Change type to
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1103,7 +1103,10 @@ kill_wait_lwp (struct lwp_info *lwp)
11031103 res = my_waitpid (lwpid, &wstat, __WCLONE);
11041104 } while (res > 0 && WIFSTOPPED (wstat));
11051105
1106- gdb_assert (res > 0);
1106+ /* Even if it was stopped, the child may have already disappeared.
1107+ E.g., if it was killed by SIGKILL. */
1108+ if (res < 0 && errno != ECHILD)
1109+ perror_with_name ("kill_wait_lwp");
11071110 }
11081111
11091112 /* Callback for `find_inferior'. Kills an lwp of a given process,