Encountered a segmentation fault while using boost::thread_specific_ptr.
It worked completely fine on my laptop but it doesn't work on our NUMA cluster.
Thread 1 "cg.C" received signal SIGSEGV, Segmentation fault.
boost::thread_specific_ptr<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > >::thread_specific_ptr (this=0x7ffff7ba2b00 <_start>) at /usr/local/include/boost/thread/tss.hpp:68
68 cleanup(detail::heap_new<delete_data>(),detail::do_heap_delete<delete_data>())
This is caused during global variable initialization.
I tried to wrap the boost::thread_specific_ptrs around using std::optional to delay the initialization, and it worked.
Seems like there is some problem during dynamic library loading.
It was the same when,
statically linked boost into a dynamic library and linking it into an executable
dynamically loading boost into the exectuable
Unfortunately, I can't test statically linking boost to the executable right now.
In case of the std::optional fix, a segmentation fault is caused during dynamic library unloading.
(see below)
Thread 1 "cg.C" received signal SIGSEGV, Segmentation fault.
boost::detail::shared_count::~shared_count (this=<optimized out>, __in_chrg=<optimized out>)
at /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:426
426 if( pi_ != 0 ) pi_->release();
(gdb) quit
A debugging session is active.
Inferior 1 [process 79251] will be killed.
Quit anyway? (y or n) y
Encountered a segmentation fault while using boost::thread_specific_ptr. It worked completely fine on my laptop but it doesn't work on our NUMA cluster.
This is caused during global variable initialization. I tried to wrap the
boost::thread_specific_ptr
s around usingstd::optional
to delay the initialization, and it worked. Seems like there is some problem during dynamic library loading. It was the same when,In case of the
std::optional
fix, a segmentation fault is caused during dynamic library unloading. (see below)