The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14511 
====================================================================== 
Reported By:                Nils Gladitz
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14511
Category:                   CMake
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-25 08:55 EDT
Last Modified:              2013-10-25 08:55 EDT
====================================================================== 
Summary:                    Makefile generators segfault when custom target
sources have compile definitions
Description: 
The Makefile generators crash when sources listed in custom targets have
COMPILE_DEFINITIONS.
Obviously these don't make much sense either but it should preferably not crash.

I could reproduce this issue with the NMake and Unix Makefiles generators.
Ninja and Visual Studio generators have no problem in this case.

Steps to Reproduce: 
CMakeLists.txt
 cmake_minimum_required(VERSION 2.8.11)
 add_custom_target(mytarget SOURCES foo.cpp)
 set_source_files_properties(foo.cpp PROPERTIES COMPILE_DEFINITIONS "FOO")

foo.cpp
 any random content


Additional Information: 
Relevant stack trace:

3       cmMakefileTargetGenerator::WriteObjectBuildFile 
cmMakefileTargetGenerator.cxx   569     0x8906f0        
4       cmMakefileTargetGenerator::WriteObjectRuleFiles 
cmMakefileTargetGenerator.cxx   467     0x88ff12        
5       cmMakefileTargetGenerator::WriteTargetBuildRules        
cmMakefileTargetGenerator.cxx   190     0x88e3db        
6       cmMakefileUtilityTargetGenerator::WriteRuleFiles        
cmMakefileUtilityTargetGenerator.cxx    62      0x8a0bc2        
7       cmLocalUnixMakefileGenerator3::Generate 
cmLocalUnixMakefileGenerator3.cxx       157     0x877050        
8       cmGlobalGenerator::Generate     cmGlobalGenerator.cxx   1128    
0x845d30        
9       cmGlobalUnixMakefileGenerator3::Generate        
cmGlobalUnixMakefileGenerator3.cxx      105     0x85f97d        
10      cmake::Generate cmake.cxx       1845    0x73df64        
11      cmake::Run      cmake.cxx       1825    0x73ddb6        
12      do_cmake        cmakemain.cxx   313     0x65cb7d        
13      main    cmakemain.cxx   177     0x65c315        

Specifically *this->FlagFileStream faults because FlagFileStream is 0.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-25 08:55 Nils Gladitz   New Issue                                    
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to