Boost C++ Libraries: Ticket #10387: Strange infinite wait in log\sinks\async_frontend.hpp https://svn.boost.org/trac10/ticket/10387 <p> <code>void asynchronous_sink::stop()</code> waits for eternity on <code>m_BlockCond.wait(lock);</code> line. When the call <code>m_BlockCond.wait(lock);</code> occurs according to <a class="missing wiki">VisualStudio</a> debugger there is no others running threads, so no one could send a signal. </p> <p> I've failed to create a minimal test case, but here is what happens according to debugger: </p> <ul><li>main thread exits the main() and enters the internal <code>__crtExitProcess(code);</code> function (line 639 in <code>Microsoft Visual Studio 11.0\VC\crt\src\crt0dat.c</code>) </li><li>Somewhere in depths of <code>ExitProcess(status)</code> the <code>m_DedicatedFeedingThread</code> silently disappears. Looks like this happens at the point when <code>m_event.wait();</code> is called (line 115 in <code>boost\log\sinks\unbounded_fifo_queue.hpp</code>) </li><li><code>void asynchronous_sink::stop()</code> is called from the main thread </li><li>main thread waits on <code>m_BlockCond.wait(lock);</code> for eternity (according to the debugger there's no more threads remain, only the main thread) </li></ul><p> If boost::log::core::get()-&gt;remove_all_sinks(); is called before exiting the main, application does not hang. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10387 Trac 1.4.3 Andrey Semashev Thu, 26 Mar 2015 09:11:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10387#comment:1 https://svn.boost.org/trac10/ticket/10387#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> If the feeding thread disappears, it is most probably cancelled by the system. I don't know Windows internals very well, but if that's the case then the hang is possible. Boost.Log does not support cancelling threads, during runtime or termination, so I'll mark it as "wont fix". You can use the remove_all_sinks() call to resolve the problem. </p> Ticket