ninja-build/ninja

ninja hanging with zombie child process

Open

#2052 opened on Nov 18, 2021

View on GitHub
 (4 comments) (6 reactions) (0 assignees)C++ (10,194 stars) (1,544 forks)batch import
bughelp wanted

Description

Occasionally, ninja is hanging after running a long-running build step, with a zombie child process present:

$  ps ax | grep ninja
32692 pts/1    S+     0:00 ninja -C build/GccReleaseASan/
$ pstree 32692 -p
ninja(32692)───sh(32702)
$ gdb -p 32702
[...]
Attaching to process 32702
warning: process 32702 is a zombie - the process has already terminated
$ gdb -p 32692
[...]
0x00007f2839c2ed39 in __GI_ppoll (fds=0x1813c60, nfds=1, timeout=<optimized out>, sigmask=0x1807b40) at ../sysdeps/unix/sysv/linux/ppoll.c:51
51          result = INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
(gdb) bt
#0  0x00007f2839c2ed39 in __GI_ppoll (fds=0x1813c60, nfds=1, timeout=<optimized out>, sigmask=0x1807b40) at ../sysdeps/unix/sysv/linux/ppoll.c:51
#1  0x000000000042e588 in SubprocessSet::DoWork() ()
#2  0x00000000004095c8 in RealCommandRunner::WaitForCommand(CommandRunner::Result*) ()
#3  0x000000000040edbb in Builder::Build(std::string*) ()
#4  0x0000000000407c1b in (anonymous namespace)::real_main(int, char**) ()
#5  0x0000000000403199 in main ()
$ ninja --version
1.10.2

Contributor guide