View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001847CMakeCMakepublic2005-05-13 08:122005-06-20 12:02
ReporterAndrey 
Assigned ToKen Martin 
PriorityurgentSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001847: SEGFAULT on empty library
Descriptioncmake version 2.1-20050513


-=-=-=-=-=-=-=- CMakeLists.txt -=-=-=-=-=-=-=-=-
PROJECT(EMPTY_LIB_BUG)

ADD_LIBRARY(EMPTY_LIB STATIC)
-=-=-=-=-=-=-=- CMakeLists.txt -=-=-=-=-=-=-=-=-

failed Program received signal SIGSEGV, Segmentation fault.
0x417d5cff in strlen () from /lib/libc.so.6
(gdb) bt
#0 0x417d5cff in strlen () from /lib/libc.so.6
#1 0x41942302 in std::string::operator+= () from /usr/lib/libstdc++.so.5
0000002 0x081a0819 in cmLocalUnixMakefileGenerator2::WriteStaticLibraryRule (this=0x82b2628, ruleFileStream=@0xbfffe6a0,
    ruleFileName=0x840d4dc "TAO_IDL.dir/TAO_IDL.make", target=@0x82ea1c4, objects=@0xbfffe820, external_objects=@0xbfffe810,
    provides_requires=@0xbfffe800) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmLocalUnixMakefileGenerator2.cxx:1736
0000003 0x08199099 in cmLocalUnixMakefileGenerator2::GenerateTargetRuleFile (this=0x82b2628, target=@0x82ea1c4)
    at /home/aka50/src/cmake/cmake-2.1.0/Source/cmLocalUnixMakefileGenerator2.cxx:403
0000004 0x08197539 in cmLocalUnixMakefileGenerator2::Generate (this=0x82b2628)
    at /home/aka50/src/cmake/cmake-2.1.0/Source/cmLocalUnixMakefileGenerator2.cxx:85
0000005 0x08183592 in cmGlobalGenerator::Generate (this=0x823e970) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmGlobalGenerator.cxx:613
0000006 0x0812af02 in cmake::Generate (this=0xbfffe9e0) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmake.cxx:1332
0000007 0x0812ad37 in cmake::Run (this=0xbfffe9e0, args=@0xbfffe9b0, noconfigure=false)
    at /home/aka50/src/cmake/cmake-2.1.0/Source/cmake.cxx:1312
0000008 0x080d9929 in do_cmake (ac=2, av=0xbfffeb64) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmakemain.cxx:245
#9 0x080d8ebb in main (ac=2, av=0xbfffeb64) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmakemain.cxx:111
(gdb) up
#1 0x41942302 in std::string::operator+= () from /usr/lib/libstdc++.so.5
(gdb) up
0000002 0x081a0819 in cmLocalUnixMakefileGenerator2::WriteStaticLibraryRule (this=0x82b2628, ruleFileStream=@0xbfffe6a0,
    ruleFileName=0x840d4dc "TAO_IDL.dir/TAO_IDL.make", target=@0x82ea1c4, objects=@0xbfffe820, external_objects=@0xbfffe810,
    provides_requires=@0xbfffe800) at /home/aka50/src/cmake/cmake-2.1.0/Source/cmLocalUnixMakefileGenerator2.cxx:1736
1736 linkRuleVar += linkLanguage;
(gdb) p linkLanguage
$1 = 0x0
with such output (gdb)
-=-=-=-=-=-=-=- CMakeLists.txt -=-=-=-=-=-=-=-=-

Looks like CMake can't determine library language and pass linkLanguage as 0.

This libraries used as jump-and-build dependencies for nonlib targets (like executables)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0002515)
Ken Martin (developer)
2005-06-20 12:02

I have fixed this so that creating an empty library is a warning in 2.2 and will probably be an error in 2.4. It no longer segfaults. I do not think there is a need for empty libraries at this point. There are no longer any jump and build rules as all the intertarget depends are known at the top level. Let me know if it isn't working for you. Thanks.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team