MantisBT - CMake
View Issue Details
0015308CMakeCPackpublic2014-12-15 04:052015-06-01 08:38
Xi Yang 
Domen Vrankar 
normalcrashalways
closedfixed 
x86_64DebianJessie
CMake 3.0.2 
CMake 3.1.1CMake 3.1.1 
0015308: CPack seg fault during stripping
While running cpack individually using a generated cpack configure file, it crashed without any error messages:

$ cpack
CPack: Create package using DEB
CPack: Install projects
Segmentation fault

The backtrace:

#0 cmCPackGenerator::InstallProjectViaInstallCMakeProjects (this=0xa21be0, setDestDir=true,
    baseTempInstallDirectory=0xa28a48 "/home/yangxi/projects/GenoEye-build/package/deb/lib/_CPack_Packages/DEB/libgenoeye") at ../../Source/CPack/cmCPackGenerator.cxx:633
#1 0x000000000049c954 in cmCPackGenerator::InstallProject (this=this@entry=0xa21be0)
    at ../../Source/CPack/cmCPackGenerator.cxx:257
0000002 0x000000000049cdef in cmCPackGenerator::DoPackage (this=0xa21be0) at ../../Source/CPack/cmCPackGenerator.cxx:1045
0000003 0x000000000048dfed in main (argc=<optimized out>, argv=<optimized out>) at ../../Source/CPack/cpack.cxx:434
The CPackConfig.cmake is attached, hopefully it could provide some hints.
No tags attached.
? CPackConfig.cmake (612) 2014-12-15 04:05
https://public.kitware.com/Bug/file/5325/CPackConfig.cmake
? core (1,806,336) 2014-12-15 20:55
https://public.kitware.com/Bug/file/5326/core
Issue History
2014-12-15 04:05Xi YangNew Issue
2014-12-15 04:05Xi YangFile Added: CPackConfig.cmake
2014-12-15 09:15Brad KingTarget Version => CMake 3.2
2014-12-15 11:55Brad KingAssigned To => Domen Vrankar
2014-12-15 11:55Brad KingStatusnew => assigned
2014-12-15 20:55Xi YangFile Added: core
2014-12-15 20:55Xi YangNote Added: 0037464
2015-01-05 06:40Domen VrankarNote Added: 0037554
2015-01-14 04:27Domen VrankarNote Added: 0037683
2015-01-14 04:27Domen VrankarStatusassigned => resolved
2015-01-14 04:27Domen VrankarFixed in Version => CMake 3.2
2015-01-14 04:27Domen VrankarResolutionopen => fixed
2015-01-14 08:45Brad KingNote Added: 0037685
2015-01-14 08:45Brad KingFixed in VersionCMake 3.2 => CMake 3.1.1
2015-01-14 08:45Brad KingTarget VersionCMake 3.2 => CMake 3.1.1
2015-06-01 08:38Robert MaynardNote Added: 0038837
2015-06-01 08:38Robert MaynardStatusresolved => closed

Notes
(0037464)
Xi Yang   
2014-12-15 20:55   
and the uploaded file "core" is the core dump file
(0037554)
Domen Vrankar   
2015-01-05 06:40   
This bug affects all cpack generators.

Problem is this line:
set(CPACK_CMAKE_GENERATOR Unix Makefiles)

Quotes are missing: "Unix Makefiles"
Because of that variable becomes a list with two elements (Unix, Makefiles) and since this is an invalid generator it doesn't get initialized and the code that checks that is missing.

I have already written a fix that detects an invalid generator name and logs it as error instead of producing a core dump. I'll upload it in the afternoon.

Was the generator that you used to generate CPackConfig.cmake file a part of CMake/CPack or some external tool?
(0037683)
Domen Vrankar   
2015-01-14 04:27   
Fixed with commit: www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f89e41c3
(0037685)
Brad King   
2015-01-14 08:45   
Since this fixes a crash, I backported it for inclusion in 3.1.1:

 CPack: Avoid crash on invalid CMake generator name
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea916230 [^]
(0038837)
Robert Maynard   
2015-06-01 08:38   
Closing resolved issues that have not been updated in more than 4 months.