MantisBT - CMake
View Issue Details
0013822CMakeCMakepublic2012-12-29 20:172016-06-10 14:31
Matt Arsenault 
Kitware Robot 
normalcrashalways
closedmoved 
Mac OS X10.8.2
CMake 2.8.10.2 
 
0013822: Crash on infinite recursion in CMake language
When running the attached test case, it crashes.

-- Detecting CXX compiler ABI info - done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5bc00bf8
0x0000000100096604 in cmCommandArgument_yyparse ()
(gdb) bt
#0 0x0000000100096604 in cmCommandArgument_yyparse ()
#1 0x0000000100098804 in cmCommandArgumentParserHelper::ParseString ()
0000002 0x0000000100150c55 in cmMakefile::ExpandVariablesInString ()
0000003 0x0000000100151ea0 in cmMakefile::ExpandArguments ()
0000004 0x0000000100065551 in cmCommand::InvokeInitialPass ()
0000005 0x0000000100146caa in cmMakefile::ExecuteCommand ()
....
Run the attached test case.

cd cmake_bug; cmake .
Installed from macports
No tags attached.
zip cmake_bug.zip (297,619) 2012-12-29 20:17
https://public.kitware.com/Bug/file/4608/cmake_bug.zip
Issue History
2012-12-29 20:17Matt ArsenaultNew Issue
2012-12-29 20:17Matt ArsenaultFile Added: cmake_bug.zip
2013-01-02 10:40Brad KingNote Added: 0031957
2013-01-02 10:40Brad KingStatusnew => backlog
2013-01-02 10:40Brad KingProduct VersionCMake 2.8.9 => CMake 2.8.10.2
2013-01-02 10:40Brad KingSummaryCrash when using LibFindMacros => Crash on infinite recursion in CMake language
2016-06-10 14:28Kitware RobotNote Added: 0042188
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0031957)
Brad King   
2013-01-02 10:40   
The example performs infinite recursion and exhausts the stack.

The libfind_package macro does find_package with the original arguments which then circles around to the original find module again.

CMake should track the call stack depth and limit it so that this case fails with an error instead of crashing.
(0042188)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.