gdbserver/Linux: internal error when killing a process that is already gone
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.c
index 7bb9f7f19fee978fdcb578794225068c28ddb2d1..2dafb033bcec62b38c930f852788895932c95748 100644 (file)
@@ -1103,7 +1103,10 @@ kill_wait_lwp (struct lwp_info *lwp)
        res = my_waitpid (lwpid, &wstat, __WCLONE);
     } while (res > 0 && WIFSTOPPED (wstat));
 
-  gdb_assert (res > 0);
+  /* Even if it was stopped, the child may have already disappeared.
+     E.g., if it was killed by SIGKILL.  */
+  if (res < 0 && errno != ECHILD)
+    perror_with_name ("kill_wait_lwp");
 }
 
 /* Callback for `find_inferior'.  Kills an lwp of a given process,
This page took 0.025287 seconds and 4 git commands to generate.