Hangs forever if delivery of SIGCHLD is blocked
The mechanism in Source/kwsys/ProcessUNIX.c relies on SIGCHLD
being delivered to the parent process to determine that the child process has exited. Yet it seems to take no precautions that this signal is not blocked in the signal mask. A cmake
launched with SIGCHLD
blocked will hang forever:
$ cat CMakeLists.txt
project(test LANGUAGES C)
$ cmake -B build
-- The C compiler identification is GNU 11.2.1
...
-- Build files have been written to: ...
$ rm -rf build
$ env --block-signal=SIGCHLD cmake -B build --trace-expand
Running with expanded trace output on.
/root/cmake_test/CMakeLists.txt(1): project(test LANGUAGES C )
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(35): if(CMAKE_HOST_UNIX )
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(36): find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(37): if(CMAKE_UNAME )
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(38): if(CMAKE_HOST_SYSTEM_NAME STREQUAL AIX )
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(44): else()
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake(45): exec_program(/usr/bin/uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION )
*hangs forever*