[SRU] cmake crashed with SIGSEGV in cmTarget::GetProperty()

Bug #1564741 reported by Matteo Settenvini
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cmake
Fix Released
Unknown
cmake (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Some cmake based projects can crash cmake

[Test Case]

* Create a cmake project that has a lot of Aliases

[Regression Potential]

* None

[Other Info]

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: cmake 3.5.1-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-16.32-generic 4.4.6
Uname: Linux 4.4.0-16-generic x86_64
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CrashCounter: 1
CurrentDesktop: GNOME
Date: Thu Mar 31 13:30:49 2016
ExecutablePath: /usr/bin/cmake
ProcCmdline: cmake -GEclipse\ CDT4\ -\ Unix\ Makefiles -DCMAKE_ECLIPSE_VERSION=4.4 -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCOMSYSTEM_TFTP_PATH=/tftpboot -GEclipse\ CDT4\ -\ Ninja -DCOMSYSTEM_VARIANT:STRING=comsystem3 -DCMAKE_INSTALL_PREFIX:PATH=/home/username/workspace/builds/comsystem3-native/development/staging/ -DCMAKE_INSTALL_LIBEXECDIR:PATH=usr/libexec -DCMAKE_SYSTEM_PREFIX_PATH=/home/username/workspace/builds/comsystem3-native/development/staging -DCMAKE_BUILD_TYPE:STRING=development /home/username/comsystem/applications
SegvAnalysis:
 Segfault happened at: 0x54afca <_ZNK8cmTarget11GetPropertyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP10cmMakefile+42>: mov 0x228(%rdi),%eax
 PC (0x0054afca) ok
 source "0x228(%rdi)" (0x00000250) not located in a known VMA region (needed readable region)!
 destination "%eax" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: cmake
StacktraceTop:
 cmTarget::GetProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cmMakefile*) const ()
 cmGetTargetPropertyCommand::InitialPass(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmExecutionStatus&) ()
 cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
 cmForEachFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) ()
 cmMakefile::IsFunctionBlocked(cmListFileFunction const&, cmExecutionStatus&) ()
Title: cmake crashed with SIGSEGV in cmTarget::GetProperty()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dialout dip lpadmin nopasswdlogin plugdev sambashare sudo vboxsf wireshark

Revision history for this message
Matteo Settenvini (tchernobog) wrote :
information type: Private → Public
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 cmTarget::GetProperty (this=0x28, prop=..., context=0x2837830) at /build/cmake-xl9RlH/cmake-3.5.1/Source/cmTarget.cxx:1558
 cmGetTargetPropertyCommand::InitialPass (this=0x2653b90, args=...) at /build/cmake-xl9RlH/cmake-3.5.1/Source/cmGetTargetPropertyCommand.cxx:46
 InvokeInitialPass (status=..., args=..., this=0x2653b90) at /build/cmake-xl9RlH/cmake-3.5.1/Source/cmCommand.h:68
 cmMakefile::ExecuteCommand (this=this@entry=0x2837830, lff=..., status=...) at /build/cmake-xl9RlH/cmake-3.5.1/Source/cmMakefile.cxx:263
 cmForEachFunctionBlocker::IsFunctionBlocked (this=0x2839fe0, lff=..., mf=..., inStatus=...) at /build/cmake-xl9RlH/cmake-3.5.1/Source/cmForEachCommand.cxx:65

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in cmake (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
Matteo Settenvini (tchernobog) wrote : Re: cmake crashed with SIGSEGV in cmTarget::GetProperty()

I bisected this down to CMake commit a67231ac114235f0af4673235c4c07fa896c8ab6.

Changed in cmake:
status: Unknown → New
Revision history for this message
Matteo Settenvini (tchernobog) wrote :

I produced a patch to fix the issue, complete with test-case. I am attaching it here, but I will also submit it upstream. It would help, in the meantime, if it was applied downstream too.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to fix the problem" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

please test the build on ppa:costamagnagianfranco/locutusofborg-ppa

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

debdiff updated

Changed in cmake:
status: New → Fix Released
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@Matteo do you plan to propose a debdiff?

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@Matteo can you please check the above debdiff and the build ongoing on ppa:costamagnagianfranco/costamagnagianfranco-ppa?
thanks

Revision history for this message
Matteo Settenvini (tchernobog) wrote :

Thanks Gianfranco, the package you provided does not crash anymore for me.

Revision history for this message
Brad King (brad.king) wrote :

This issue is fixed by upstream patch release 3.5.2.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

thanks, I'm going to ask to merge it soon. marking as fix released for yakkety for now

Changed in cmake (Ubuntu):
status: New → Fix Released
Revision history for this message
Christian Fetzer (fetzer-ch) wrote :

@LocutusOfBorg: Mind backporting this fix also to xenial?
The diff between 3.5.1 and 3.5.2 looks small enough to not cause any regressions: https://cmake.org/Bug/view_all_bug_page.php?filter=161388

I'm working on porting kodi's build system to cmake and we're and affected by this.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

lets ask for a sponsor then!

Changed in cmake (Ubuntu):
status: Fix Released → New
description: updated
summary: - cmake crashed with SIGSEGV in cmTarget::GetProperty()
+ [SRU] cmake crashed with SIGSEGV in cmTarget::GetProperty()
Changed in cmake (Ubuntu):
status: New → Fix Released
Graham Inggs (ginggs)
Changed in cmake (Ubuntu Xenial):
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Matteo, or anyone else affected,

Accepted cmake into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cmake/3.5.1-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cmake (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

cmake updated!

so far so good

tags: added: verification-done
removed: verification-needed
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@Christian please double check!

Revision history for this message
Christian Fetzer (fetzer-ch) wrote :

@LocutusOfBorg: Confirming, the fix works. Thanks!

Just for reference, for my usecase (building Kodi), I would have preferred an update to CMake 3.5.2. Then I could simply have checked for the CMake version 3.5.1 in the build scripts and opt out directly with an error informing that 3.5.1 is not supported and devs have to update to at least 3.5.2. Now 3.5.1 will work on Ubuntu, but won't work on other distributions (except if they also carry that downstream patch along). But I guess this is simply how the Ubuntu release strategy works.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Well, I'm not sure updating cmake to a new minor release in a stable Ubuntu LTS is worth the effort...

I admit I was tempted, but too many packages relies on it, and I think before upgrading we should at least do an archive rebuild just to check everything still builds.

For sure cherry-picking a patch is the safest way to fix the bug, but I admit I would have upgraded cmake with not many issues (the debdiff is not scary)

Revision history for this message
Christian Fetzer (fetzer-ch) wrote :

@LocutusOfBorg: Most important is that the bug is resolved. I don't know what it takes to get the full stack compile tested with a newer version. But you're probably right and it's better to play safe here.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cmake - 3.5.1-1ubuntu2

---------------
cmake (3.5.1-1ubuntu2) xenial; urgency=medium

  * cherry-picks from upstream to fix a GetProperty() crash (LP: #1564741):
    - debian/patches/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch
    - debian/patches/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch

 -- Gianfranco Costamagna <email address hidden> Mon, 04 Apr 2016 10:04:07 +0200

Changed in cmake (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for cmake has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.