Boost logo

Boost Users :

Subject: Re: [Boost-users] Boostlog and ASIO crash in shared library
From: Sohail Somani (sohail_at_[hidden])
Date: 2014-09-16 22:48:16


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net