Handle sighandling.KillItself() return error.

Call dumpAndPanicSyscallError for the rare case where we fail to kill the the
Sentry upon detecting an unexpected stub exit. This will provide enough
information determine if a panic occur due to failed SIGKILL attempt or an
unexpected event.

PiperOrigin-RevId: 737751257
This commit is contained in:
Jimmy Tran
2025-03-17 14:29:52 -07:00
committed by gVisor bot
parent 768c0364e4
commit 8d5f3c982a
+5 -1
View File
@@ -609,7 +609,11 @@ func (t *thread) unexpectedStubExit() {
// these cases, we don't need to panic. There is no reasons to
// think that something wrong in gVisor.
log.Warningf("The ptrace stub process %v has been killed by SIGKILL.", t.tgid)
sighandling.KillItself()
err := sighandling.KillItself()
if err != nil {
t.dumpAndPanic(fmt.Sprintf(
"failed to kill the process %d:%d: %v", t.tgid, t.tid, err))
}
}
t.dumpAndPanic(fmt.Sprintf("wait failed: the process %d:%d exited: %x (err %v)", t.tgid, t.tid, msg, err))
}