PHILIP LONG

PhD, ROBOTICIST

I was recently trying to use PCL's convex hull functions and even though I had successfully ran it before this time it didn't work. The thing is, it compiles successfully but seg faults immediately on startup. As I was editing a large library, I didn't know what was going on. Anyway it turns out, this is a well know issue with PCL documented here , here , here , here , and here . The accepted solution seems to be either don't use C++11 or recompile PCL with C++11. It seems the issue comes from different compiler versions in the boost libraries. I eventually got round the problem by adding a a few tags in the CMakelists file (I think one of the git issues said as much).

1. My System information

  • Ubuntu 14.04
  • Boost version: 1.54.0
  • PCL 1.7
  • The CXX compiler identification is GNU 4.8.4
  • 2. Problem

    Running my ros node as follows

    rosrun --prefix 'gdb --args' </code>

    yielded

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff3453ae0 in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_sample_consensus.so.1.7
    
    
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff3453ae0 in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_sample_consensus.so.1.7
    (gdb) bt
    #0  0x00007ffff3453ae0 in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_sample_consensus.so.1.7
    #1  0x00007ffff342b5ce in ?? () from /usr/lib/libpcl_sample_consensus.so.1.7
    #2  0x00007ffff7dea1da in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffcf18, env=env@entry=0x7fffffffcf28) at dl-init.c:78
    #3  0x00007ffff7dea2c3 in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:36
    #4  _dl_init (main_map=0x7ffff7ffe1c8, argc=1, argv=0x7fffffffcf18, env=0x7fffffffcf28) at dl-init.c:126
    #5  0x00007ffff7ddb29a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
    #6  0x0000000000000001 in ?? ()
    #7  0x00007fffffffd380 in ?? ()
    #8  0x0000000000000000 in ?? ()
    

    3. Work-around

    To resolve the issue the following tags were put in the CMakelists

      
    if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
      
      message(STATUS "Setting build type to 'Release' as none was specified.")
      
      set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
      
      set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" 
        "MinSizeRel" "RelWithDebInfo")
       
    endif()
    

    And voilĂ ! 4 hours of my life I'm never getting back.

    -->