MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015873 | CMake | CMake | public | 2015-12-07 04:16 | 2016-06-10 14:31 |
Reporter | Ralf Mitschke | ||||
Assigned To | Kitware Robot | ||||
Priority | high | Severity | block | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | 64bit (virtual machine) | OS | Suse Linux Enterprise | OS Version | 12 |
Product Version | CMake 3.3.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0015873: 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: #0 0x00007fab1410ea43 in __select_nocancel () from /lib64/libc.so.6 #1 0x00000000007eb662 in cmsysProcess_WaitForData () 0000002 0x00000000005c91ac in cmSystemTools::RunSingleCommand(std::vector<std::string, std::allocator<std::string> > const&, std::string*, std::string*, int*, char const*, cmSystemTools::OutputOption, double) () 0000003 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&) () 0000004 0x000000000053d093 in cmGlobalGenerator::TryCompile(std::string const&, std::string const&, std::string const&, std::string const&, bool, std::string&, cmMakefile*) () 0000005 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&) () 0000006 0x0000000000676745 in cmCoreTryCompile::TryCompileCode(std::vector<std::string, std::allocator<std::string> > const&) () 0000007 0x0000000000688453 in cmTryCompileCommand::InitialPass(std::vector<std::string, std::allocator<std::string> > const&, cmExecutionStatus&) () 0000008 0x0000000000584374 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () #9 0x00000000006ac560 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) () 0000010 0x00000000005841b1 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () #11 0x000000000065065f in cmFunctionHelperCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) () 0000012 0x00000000005845cd in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () 0000013 0x00000000006ac560 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) () 0000014 0x00000000005841b1 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () 0000015 0x00000000005848cc in cmMakefile::ReadListFileInternal(char const*, bool, bool) () 0000016 0x0000000000585c6d in cmMakefile::ReadListFile(char const*, bool, bool) () 0000017 0x0000000000586614 in cmMakefile::ReadListFile(char const*) () 0000018 0x0000000000542e3c in cmGlobalGenerator::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, cmMakefile*, bool) () 0000019 0x0000000000768d9d in cmGlobalUnixMakefileGenerator3::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, cmMakefile*, bool) () 0000020 0x0000000000577313 in cmMakefile::EnableLanguage(std::vector<std::string, std::allocator<std::string> > const&, bool) () 0000021 0x00000000006a6ab7 in cmProjectCommand::InitialPass(std::vector<std::string, std::allocator<std::string> > const&, cmExecutionStatus&) () 0000022 0x0000000000584374 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) () 0000023 0x00000000005848cc in cmMakefile::ReadListFileInternal(char const*, bool, bool) () 0000024 0x0000000000585c6d in cmMakefile::ReadListFile(char const*, bool, bool) () 0000025 0x0000000000586428 in cmMakefile::ProcessBuildsystemFile(char const*) () 0000026 0x000000000055f9fd in cmLocalGenerator::Configure() () 0000027 0x0000000000795ad6 in cmLocalUnixMakefileGenerator3::Configure() () 0000028 0x000000000054b0dc in cmGlobalGenerator::Configure() () 0000029 0x0000000000768fbc in cmGlobalUnixMakefileGenerator3::Configure() () 0000030 0x0000000000600a07 in cmake::ActualConfigure() () 0000031 0x0000000000605523 in cmake::Configure() () 0000032 0x000000000060946c in cmake::Run(std::vector<std::string, std::allocator<std::string> > const&, bool) () 0000033 0x000000000050eb76 in do_cmake(int, char const* const*) () 0000034 0x00000000005103ee in main () | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-12-07 04:16 | Ralf Mitschke | New Issue | |||
2015-12-21 16:55 | michael.smith | Note Added: 0040019 | |||
2016-01-11 06:19 | Anton Astafiev | Note Added: 0040176 | |||
2016-01-11 06:20 | Anton Astafiev | Note Edited: 0040176 | bug_revision_view_page.php?bugnote_id=40176#r1994 | ||
2016-01-11 08:58 | Brad King | Note Added: 0040177 | |||
2016-01-11 10:30 | Ralf Mitschke | Note Added: 0040183 | |||
2016-01-11 11:03 | Brad King | Note Added: 0040186 | |||
2016-01-11 11:04 | Brad King | Note Added: 0040187 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042896 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|