The following issue has been SUBMITTED. ====================================================================== https://public.kitware.com/Bug/view.php?id=15873 ====================================================================== Reported By: Ralf Mitschke Assigned To: ====================================================================== Project: CMake Issue ID: 15873 Category: CMake Reproducibility: always Severity: block Priority: high Status: new ====================================================================== Date Submitted: 2015-12-07 04:16 EST Last Modified: 2015-12-07 04:16 EST ====================================================================== Summary: CMake hangs indefinitely after executing other tools (e.g., gmake, getconf, file) Description: CMake is used in a virtual machine environment and started from Jenkins for large scale build automation of C++ based projects (so not only a single project).
The error mostly occurs in the compiler detection phase. The spawned gmake or getconf processes CMake calls are reported as zombie processes in the OS. The cmake process then hangs indefinitely in on a select statement to a UNIX pipe it needs for inter-process communication (a stack trace is posted as additional information). The issue was even observed earlier in the build, where CMake was executing the process "file", possibly to read the CMakeLists.txt or another input file. The frequency of the occurrence varies from machine to machine. But overall, it happens reliably in 1 of 500 runs. I suspect it is a timing issue and outside of automation not often found. As a workaround, I created a patched version of the file Source/kwsys/ProcessUNIX.c There was some code to completely remove the pipe select mechanism and revert to polling the pipes. By switching the following definition to false we got around the problem: # define KWSYSPE_USE_SELECT 0 But CMake seems to get slower when not using selects. Steps to Reproduce: - Create a simple C++ project - Run a batch script to start the build 1000 times. Additional Information: Stack trace where CMake hangs in pipe select statement: https://public.kitware.com/Bug/view.php?id=0 0x00007fab1410ea43 in __select_nocancel () from /lib64/libc.so.6 https://public.kitware.com/Bug/view.php?id=1 0x00000000007eb662 in cmsysProcess_WaitForData () https://public.kitware.com/Bug/view.php?id=2 0x00000000005c91ac in cmSystemTools::RunSingleCommand(std::vector<std::string, std::allocator<std::string> > const&, std::string*, std::string*, int*, char const*, cmSystemTools::OutputOption, double) () https://public.kitware.com/Bug/view.php?id=3 0x000000000053c9f3 in cmGlobalGenerator::Build(std::string const&, std::string const&, std::string const&, std::string const&, std::string&, std::string const&, std::string const&, bool, bool, bool, double, cmSystemTools::OutputOption, std::vector<std::string, std::allocator<std::string> > const&) () https://public.kitware.com/Bug/view.php?id=4 0x000000000053d093 in cmGlobalGenerator::TryCompile(std::string const&, std::string const&, std::string const&, std::string const&, bool, std::string&, cmMakefile*) () https://public.kitware.com/Bug/view.php?id=5 0x00000000005745bc in cmMakefile::TryCompile(std::string const&, std::string const&, std::string const&, std::string const&, bool, std::vector<std::string, std::allocator<std::string> > const*, std::string&) () https://public.kitware.com/Bug/view.php?id=6 0x0000000000676745 in cmCoreTryCompile::TryCompileCode(std::vector<std::string, std::allocator<std::string> > const&) () https://public.kitware.com/Bug/view.php?id=7 0x0000000000688453 in cmTryCompileCommand::InitialPass(std::vector<std::string, std::allocator<std::string> > const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=8 0x0000000000584374 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=9 0x00000000006ac560 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=10 0x00000000005841b1 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=11 0x000000000065065f in cmFunctionHelperCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=12 0x00000000005845cd in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=13 0x00000000006ac560 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=14 0x00000000005841b1 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=15 0x00000000005848cc in cmMakefile::ReadListFileInternal(char const*, bool, bool) () https://public.kitware.com/Bug/view.php?id=16 0x0000000000585c6d in cmMakefile::ReadListFile(char const*, bool, bool) () https://public.kitware.com/Bug/view.php?id=17 0x0000000000586614 in cmMakefile::ReadListFile(char const*) () https://public.kitware.com/Bug/view.php?id=18 0x0000000000542e3c in cmGlobalGenerator::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, cmMakefile*, bool) () https://public.kitware.com/Bug/view.php?id=19 0x0000000000768d9d in cmGlobalUnixMakefileGenerator3::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, cmMakefile*, bool) () https://public.kitware.com/Bug/view.php?id=20 0x0000000000577313 in cmMakefile::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, bool) () https://public.kitware.com/Bug/view.php?id=21 0x00000000006a6ab7 in cmProjectCommand::InitialPass(std::vector<std::string, std::allocator<std::string> > const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=22 0x0000000000584374 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () https://public.kitware.com/Bug/view.php?id=23 0x00000000005848cc in cmMakefile::ReadListFileInternal(char const*, bool, bool) () https://public.kitware.com/Bug/view.php?id=24 0x0000000000585c6d in cmMakefile::ReadListFile(char const*, bool, bool) () https://public.kitware.com/Bug/view.php?id=25 0x0000000000586428 in cmMakefile::ProcessBuildsystemFile(char const*) () https://public.kitware.com/Bug/view.php?id=26 0x000000000055f9fd in cmLocalGenerator::Configure() () https://public.kitware.com/Bug/view.php?id=27 0x0000000000795ad6 in cmLocalUnixMakefileGenerator3::Configure() () https://public.kitware.com/Bug/view.php?id=28 0x000000000054b0dc in cmGlobalGenerator::Configure() () https://public.kitware.com/Bug/view.php?id=29 0x0000000000768fbc in cmGlobalUnixMakefileGenerator3::Configure() () https://public.kitware.com/Bug/view.php?id=30 0x0000000000600a07 in cmake::ActualConfigure() () https://public.kitware.com/Bug/view.php?id=31 0x0000000000605523 in cmake::Configure() () https://public.kitware.com/Bug/view.php?id=32 0x000000000060946c in cmake::Run(std::vector<std::string, std::allocator<std::string> > const&, bool) () https://public.kitware.com/Bug/view.php?id=33 0x000000000050eb76 in do_cmake(int, char const* const*) () https://public.kitware.com/Bug/view.php?id=34 0x00000000005103ee in main () ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-12-07 04:16 Ralf Mitschke New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers