0
$\begingroup$

Rosanswers logo

Hello,

when I'm trying to use pcl::registration::CorrespondenceRejectorSampleConsensus class in my ROS node, I got Segmentation fault even before the node is initialized. I prepared minimal example pakage showing this problem. Some additional information:

  • I've installed ROS Indigo on my Ubuntu 14.04 using standard installation guide
  • I verified this issue on two independent machines with ROS Indigo installation
  • I've already asked for the help on PCL forum but I've got the response that it's not an issue of the latest PCL released
  • the strangest thing is that event the segfault occurs even before the initialisation is done

To run the problem example:

  1. unzip the package into your workspace
  2. use catkin_make to build it
  3. execute: rosrun sac_segmentation_fault seg_fault
  4. you should obtain the segmentation fault and nothing else is printed into the console

Thank you in advance for any help or advices, Martin.


Originally posted by MartinVelas on ROS Answers with karma: 13 on 2014-10-10

Post score: 1


Original comments

Comment by MartinVelas on 2014-10-10:
Hello and thanks for your quick answer - it was very helpful :)

I used the output of the GDB you proposed and after few minutes of Googling I found out that many people have similar problem and the only common nominator was usage of C++11 - not supported by PCL so far. Removing "-std=c++0x" from my CMakeLists.txt worked as charm.

Thanks again for your help.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If it works with the latest version of pcl, but not with the older version of pcl there is probably a patch which has been applied to pcl between those versions which fixes it, I'd suggest looking there. You should also dig in with gdb and try to find the actual issue with the memory causing the segfault.

Edit:

Looking closer, this is just a bug in PCL, there's nothing ROS releated. I removed all the ROS related code and it still segfaults.

tfoote@yeti:/tmp/testexample/devel$ gdb ./lib/sac_segmentation_fault/seg_fault 
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/testexample/devel/lib/sac_segmentation_fault/seg_fault...done.
(gdb) r
Starting program: /tmp/testexample/devel/./lib/sac_segmentation_fault/seg_fault 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff739a830 in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() ()
   from /usr/lib/libpcl_sample_consensus.so.1.7
(gdb) ls
Undefined command: "ls".  Try "help".
(gdb) list
1   #include <iostream>
2   #include <pcl/registration/correspondence_rejection_sample_consensus.h>
3   
4   int main(int argc, char *argv[]) {
5     pcl::registration::CorrespondenceRejectorSampleConsensus<pcl::PointXYZ> registration;
6     return 0;
7   }
(gdb) 

Originally posted by tfoote with karma: 58457 on 2014-10-10

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.