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

I get the following error only when I debug using gdb for my code compiled with a 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)

Please note: when starting external gdb, there is no segfault.

+5
source share
1 answer

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

I solved the problem of optimizing compiled code (in Debug mode) with the -O1 option. those. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O1") .

I do not understand why this works, but it works for me.

+6
source

Source: https://habr.com/ru/post/1204591/


All Articles