mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
ptrace: detect if a stub process exited unexpectedly
PiperOrigin-RevId: 263880577
This commit is contained in:
@@ -354,6 +354,9 @@ func (t *thread) wait(outcome waitOutcome) syscall.Signal {
|
||||
continue // Spurious stop.
|
||||
}
|
||||
if stopSig == syscall.SIGTRAP {
|
||||
if status.TrapCause() == syscall.PTRACE_EVENT_EXIT {
|
||||
t.dumpAndPanic("wait failed: the process exited")
|
||||
}
|
||||
// Re-encode the trap cause the way it's expected.
|
||||
return stopSig | syscall.Signal(status.TrapCause()<<8)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user