From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2020-02-29 13:10:27
On 2020-02-29 16:09, Andrey Semashev wrote:
> On 2020-02-29 14:24, JH via Boost wrote:
>> I built boost::log in my application library, it created
>> and close it by calling the
>> boost::log::core::get()->remove_all_sinks() in destructor of the Log
>> library, then one of my application link to my log library got
>> Segmentation fault when it exited:
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff5fdd961 in
>> boost::log::v2_mt_posix::core::remove_all_sinks() ()
>> Â Â Â from /usr/lib/x86_64-linux-gnu/libboost_log.so.1.65.1
>> If I add boost::log::core::get()->remove_all_sinks() in my application
>> main before it return 0, the segmentation was gong, but it stuck.
>> What is the proper right way to close and clean the boost::log? There
>> is a blog suggested to run boost::log::core::get()->remove_all_sinks()
>> when the main end, but that does not seem work.
> The right way is to call remove_all_sinks at the end of main, and not
> use logging after that. E.g. you shouldn't use logging library in global
> Regarding hanging, you need to investigate what causes the hang.
Also, if you're keeping shared pointers referring to the sink backends,
you should reset those pointers before returning from main.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk