[SRU] libpcl cflags -march=native -msse4.2 makes user-compiled programs crash

Bug #1771124 reported by kervel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcl (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Gianfranco Costamagna

Bug Description

[ Impact ]
* It is currently impossible to use the library, without making programs that crash during startup

[ Test case ]
* Attached and in Other info section

[ Regression Potential ]
* Fix is uploaded in cosmic, waiting for build/migration

[ Other Info ]
in /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake, line 780, the cflags for PCL are defined like this:
list(APPEND PCL_DEFINITIONS -march=native -msse4.2 -mfpmath=sse )

however, when using -march=native -msse4.2, even simple user-compiled programs crash in eigen's handmade_aligned_free. I attached a minimal testcase for this (the program crashes on ubuntu artful and bionic, but not on zesty). Problem was on a dell xps13 (since -march=native is hardware-dependent, on some systems the problem might not be reproducible)

see also this email thread http://www.pcl-users.org/Segfaults-in-eigen-s-handmade-aligned-free-on-ubuntu-artful-td4045237.html

CMakeLists.txt for the program in attach:

cmake_minimum_required(VERSION 2.8)
project(crashdemo)
find_package(Boost 1.54 REQUIRED COMPONENTS filesystem)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
set(OUR_Boost_LIBRARIES ${Boost_LIBRARIES})
find_package(PCL 1.8 REQUIRED COMPONENTS common io segmentation visualization filters)
add_definitions(${PCL_DEFINITIONS})
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_executable(crasher
 src/crasher.cpp
)
target_link_libraries(crasher
 ${OUR_Boost_LIBRARIES}
 ${Boost_LIBRARIES}
 ${PCL_LIBRARIES}
)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libpcl-dev 1.8.1+dfsg1-2ubuntu2
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: GNOME
Date: Mon May 14 15:18:46 2018
InstallationDate: Installed on 2016-10-23 (567 days ago)
InstallationMedia: Ubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2)
SourcePackage: pcl
UpgradeStatus: Upgraded to bionic on 2018-05-09 (4 days ago)

Revision history for this message
kervel (frank-dekervel) wrote :
Changed in pcl (Ubuntu Bionic):
assignee: nobody → Gianfranco Costamagna (costamagnagianfranco)
Changed in pcl (Ubuntu Bionic):
status: New → In Progress
summary: - libpcl cflags -march=native -msse4.2 makes user-compiled programs crash
+ [SRU] libpcl cflags -march=native -msse4.2 makes user-compiled programs
+ crash
description: updated
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

root@Unimatrix04-Bionic:/test/crash# ./crasher
root@Unimatrix04-Bionic:/test/crash# echo $?
0

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

without this patch I get a segfault

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

This bug was fixed in the package pcl - 1.8.1+dfsg1-4ubuntu2

---------------
pcl (1.8.1+dfsg1-4ubuntu2) cosmic; urgency=medium

  [ Jochen Sprickerhof ]
  * Cherry-pick two upstream pull requests to fix boost 1.67 sadness
    - debian/patches/2422.patch
    - debian/patches/2338.patch

  [ Gianfranco Costamagna ]
  * lower parallelism on ppc64el too, to workaround an OOM failure

 -- Gianfranco Costamagna <email address hidden> Mon, 10 Sep 2018 08:12:28 +0200

Changed in pcl (Ubuntu):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, since the upload looks good in overall I'll accept it as is, but it's missing a changelog entry for the removal of parallelism during build - but this seems more like a build fix so not treating it as blocking.

Changed in pcl (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello kervel, or anyone else affected,

Accepted pcl into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pcl/1.8.1+dfsg1-2ubuntu2.18.04.1 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 on 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
kervel (frank-dekervel) wrote :

Hello,

i tried the version in -proposed and the crash no longer occurs.
i also verified that the prebuilt pcl apps still work (ok) and that a more complex pcl-based project still builds and works. everything looks good.

thanks!
Frank

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

# ./crasher
# echo $?
0

fix confirmed.

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

This bug was fixed in the package pcl - 1.8.1+dfsg1-2ubuntu2.18.04.1

---------------
pcl (1.8.1+dfsg1-2ubuntu2.18.04.1) bionic; urgency=medium

  [ Jochen Sprickerhof ]
  * Disable automatic SSE detection (LP: #1771124)
  * Lower debug information, to avoid gcc ICE during build
  * Add patch to ship a pkgconfig file (LP: #1738902)

 -- Gianfranco Costamagna <email address hidden> Mon, 10 Sep 2018 08:22:16 +0200

Changed in pcl (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for pcl 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.