View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013702CMakeCMakepublic2012-11-19 00:072013-04-17 08:54
ReporterNick Hutchinson 
Assigned ToBrad King 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version12.10
Product VersionCMake 2.8.10.1 
Target VersionCMake 2.8.10.2Fixed in VersionCMake 2.8.10.2 
Summary0013702: CMake crashes when reconfiguring build
DescriptionAttached is a reduced test case that reliably crashes CMake.
Steps To Reproduce1. Execute the following commands:
~~~~~
mkdir build && cd build
cmake ../path/to/source/folder -DCMAKE_C_COMPILER=cc -DFOOBAR=0
~~~~~
CMake should abort the configure with the message: "CMake Error at CMakeLists.txt:8 (message): FOOBAR was not set"

2. Execute the following command:
cmake ../path/to/source/folder -DCMAKE_C_COMPILER=cc -DFOOBAR=1

Expected behaviour:
CMake reconfigures the project.

Actual behaviour:
CMake displays the following message, then crashes:
~~~~~~
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= cc

CMake Error at CMakeLists.txt:3 (add_library):
  add_library cannot create imported target "testlib" because another target
  with the same name already exists.

[1] 20462 segmentation fault (core dumped) cmake ../ -DCMAKE_C_COMPILER=cc -DFOOBAR=1
Additional InformationCore dump is included in the attachment.
TagsNo tags attached.
Attached Fileszip file icon CMake Crash.zip [^] (158,517 bytes) 2012-11-19 00:07

 Relationships

  Notes
(0031607)
Brad King (manager)
2012-11-19 08:43

Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ff75873 [^]

The issue has existed since CMake 2.8.8. The fix patch should apply to that version of CMake through 2.8.10.1.

Work around the issue by always specifying the compiler via the "CC" environment variable or always passing a full path to the compiler to CMAKE_C_COMPILER.
(0032884)
Robert Maynard (manager)
2013-04-17 08:54

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-11-19 00:07 Nick Hutchinson New Issue
2012-11-19 00:07 Nick Hutchinson File Added: CMake Crash.zip
2012-11-19 08:30 Brad King Assigned To => Brad King
2012-11-19 08:30 Brad King Status new => assigned
2012-11-19 08:43 Brad King Note Added: 0031607
2012-11-19 08:43 Brad King Fixed in Version => CMake 2.8.11
2012-11-19 08:43 Brad King Target Version => CMake 2.8.11
2012-11-19 08:43 Brad King Status assigned => resolved
2012-11-19 08:43 Brad King Resolution open => fixed
2012-11-27 15:22 David Cole Fixed in Version CMake 2.8.11 => CMake 2.8.10.2
2012-11-27 15:22 David Cole Target Version CMake 2.8.11 => CMake 2.8.10.2
2013-04-17 08:54 Robert Maynard Note Added: 0032884
2013-04-17 08:54 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team