View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016048CMakeCMakepublic2016-04-01 15:222016-06-10 14:21
Reporterarlbranch 
Assigned To 
PriorityhighSeveritycrashReproducibilityalways
StatusclosedResolutionduplicate 
Platformx86_64OSLinuxOS Version4.4.5-1-ARCH
Product VersionCMake 3.5.1 
Target VersionFixed in Version 
Summary0016048: Segfault on target_link_libraries() with aliased target from another subdirectory
DescriptionCMake crashes with a segfault when target_link_libraries is used to add a dependency on an alias of a target that was added in a different subdirectory.

Complete Example
================
[branch@fortuna on /dev/pts/1] 1150 ~/repositories/test/cmake_segfault
$ cmake --version
cmake version 3.5.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[branch@fortuna on /dev/pts/1] 1151 ~/repositories/test/cmake_segfault
$ ls -lR
.:
total 12
drwxr-xr-x 2 branch atlsdd 4096 Apr 1 13:37 alib/
drwxr-xr-x 2 branch atlsdd 4096 Apr 1 14:14 blib/
-rw-r--r-- 1 branch atlsdd 98 Apr 1 13:18 CMakeLists.txt

./alib:
total 4
-rw-r--r-- 1 branch atlsdd 87 Apr 1 13:24 CMakeLists.txt

./blib:
total 4
-rw-r--r-- 1 branch atlsdd 162 Apr 1 13:38 CMakeLists.txt
[branch@fortuna on /dev/pts/1] 1152 ~/repositories/test/cmake_segfault
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
project(top)
add_subdirectory(alib)
add_subdirectory(blib)
[branch@fortuna on /dev/pts/1] 1153 ~/repositories/test/cmake_segfault
$ cat alib/CMakeLists.txt
add_library(alib alib.c)
set_source_files_properties(alib.c PROPERTIES GENERATED TRUE)
[branch@fortuna on /dev/pts/1] 1154 ~/repositories/test/cmake_segfault
$ cat blib/CMakeLists.txt
add_library(blib blib.c)
set_source_files_properties(blib.c PROPERTIES GENERATED TRUE)

add_library(alib::alib ALIAS alib)
target_link_libraries(blib alib::alib)
[branch@fortuna on /dev/pts/1] 1155 ~/repositories/test/cmake_segfault
$ mkdir build && cd build
[branch@fortuna on /dev/pts/1] 1156 ~/repositories/test/cmake_segfault/build
$ cmake ..
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Segmentation fault (core dumped)
Steps To Reproduce1) create the project in the Description
2) run cmake against it
Additional InformationAlso seen on MacOS.

This is a regression, cmake 3.4 does not crash.
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0016044closedBrad King cmake crashed with SIGSEGV in cmTarget::GetProperty() 

  Notes
(0040798)
Brad King (manager)
2016-04-01 15:30

This looks the same as 0016044. Please try the fix linked in 0016044:0040796.
(0040799)
Brad King (manager)
2016-04-01 15:43

Thanks for the small test case. This helped me improve testing for the fix in 0016044. I'll follow-up with a note about it there.
(0041204)
Kitware Robot (administrator)
2016-06-10 14:21

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.

 Issue History
Date Modified Username Field Change
2016-04-01 15:22 arlbranch New Issue
2016-04-01 15:30 Brad King Relationship added duplicate of 0016044
2016-04-01 15:30 Brad King Note Added: 0040798
2016-04-01 15:43 Brad King Note Added: 0040799
2016-04-01 15:43 Brad King Status new => resolved
2016-04-01 15:43 Brad King Resolution open => duplicate
2016-06-10 14:21 Kitware Robot Note Added: 0041204
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team