Skip to content

New Linux sandbox sometimes hangs with defunct child process #1671

@philwo

Description

@philwo

The PID1 process of the new Linux sandbox sometimes doesn't seem to notice that its child process died and gets stuck with this stack trace:

linux-sandbox.cc:
#0 0x00007f8c706faa0c in __libc_waitpid (pid=9124, stat_loc=0x7fffc2f6e658, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31
#1 0x0000000000402e0b in WaitForPid1() ()
#2 0x000000000040339d in main ()

linux-sandbox-pid1.cc:
#0 do_sigwait (sig=0x7f8c7141cf5c, set=) at ../nptl/sysdeps/unix/sysv/linux/../../../../../sysdeps/unix/sysv/linux/sigwait.c:63
#1 __GI___sigwait (set=, sig=0x7f8c7141cf5c) at ../nptl/sysdeps/unix/sysv/linux/../../../../../sysdeps/unix/sysv/linux/sigwait.c:93
#2 0x0000000000409ec3 in WaitForChild() ()
#3 0x0000000000409f85 in Pid1Main(void*) ()
#4 0x00007f8c7073437d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Running "kill -CHLD" on the pid1 process lets it continue and the build completes successfully. It seems to happen randomly, about once in three "bazel build //src:bazel" clean builds.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions