Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debug seg fault in boost::math::lanczos with libpcl_surface

I get the following error only when I debug using gdb on my code compiled with debug flag

Program received signal SIGSEGV, Segmentation fault.
0x00007fffc79a7ff0 in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() ()
from /usr/lib/libpcl_surface.so.1.7

OS: unbutu 14.04

I have the latest pcl library (1.7 Sprikelhof) and boost library (1.54)

Note, there is no segfault when running outside gdb.

like image 815
Geronimo Avatar asked Oct 13 '14 18:10

Geronimo


1 Answers

I had a similar issue when compiling using -std=c++11 but only in Debug mode: set(CMAKE_BUILD_TYPE Debug). In Release or RelWithDebInfo mode, instead, everything was working as expected.

I solved the issue optimizing the compiled code (in Debug mode) with the -O1 option. i.e. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O1").

I don't why it works but it's working for me.

like image 178
Filippo Basso Avatar answered Sep 29 '22 09:09

Filippo Basso