Skip to content

Commit 1bd04bc

Browse files
EtiennePerotgvisor-bot
authored andcommitted
Ignore sysmsg tgkill errors if the sysmsg thread is already dead.
This can happen in case the entire sandbox is being torn down unceremoniously such that the order of who dies first isn't controlled for. I am not sure if this should also set `sc.subprocess.dead`, as the `tgkill` seems to be specifically about a sysmsg thread associated with this subprocess, not about the subprocess itself. PiperOrigin-RevId: 750384169
1 parent a70f559 commit 1bd04bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sentry/platform/systrap/shared_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (sc *sharedContext) NotifyInterrupt() {
141141
}
142142

143143
t := sysmsgThread.thread
144-
if e := hostsyscall.RawSyscallErrno(unix.SYS_TGKILL, uintptr(t.tgid), uintptr(t.tid), uintptr(platform.SignalInterrupt)); e != 0 {
144+
if e := hostsyscall.RawSyscallErrno(unix.SYS_TGKILL, uintptr(t.tgid), uintptr(t.tid), uintptr(platform.SignalInterrupt)); e != 0 && e != unix.ESRCH {
145145
panic(fmt.Sprintf("failed to interrupt the child process %d: %v", t.tid, e))
146146
}
147147
}

0 commit comments

Comments
 (0)