ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Segmentation fault when using CorrespondenceRejectorSampleConsensus

asked 2014-10-10 07:28:22 -0600

MartinVelas gravatar image


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.

edit retag flag offensive close merge delete


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.

MartinVelas gravatar image MartinVelas  ( 2014-10-10 16:59:31 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-10 15:50:11 -0600

tfoote gravatar image

updated 2014-10-10 15:56:57 -0600

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.


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 <>
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:
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/".

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-10 07:27:22 -0600

Seen: 49,721 times

Last updated: Oct 10 '14