17 Sep
2014
17 Sep
'14
2:48 a.m.
On 2014-09-16, 3:08 AM, Ray Cheng wrote:
My project use a simple main using dlopen to "run" the real main function in target shared library. I use both Boost Log and ASIO (for threadpool) in the project. In Linux I found the ASIO got weird behavior with some un-initialized variables and crashing all the time. I am able to trim down my problem into a small program as below:
There might be some interaction with BOOST_LOG_USE_COMPILER_TLS from the sounds of it. Try disabling/enabling that and see if that narrows it down further. It does look like you're doing the right thing, but ensure that your shared object will invoke global C++ constructors. I remember some *nix somewhere at some time that didn't do this. Sohail