Subject: [Boost-bugs] [Boost C++ Libraries] #10381: Boost log mutex lock failure
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-08-19 18:08:51
#10381: Boost log mutex lock failure
-----------------------+------------------------------
Reporter: anonymous | Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.56.0
Severity: Problem | Keywords:
-----------------------+------------------------------
I'm using add_console_log(), passing it std::clog. When I build in release
with optimizations, everything works fine. When building in debug without
optimizations though, when my program exits there's a core dump as a
result of the assertion on destruction of the mutex lock failing
(pthread_mutex_destroy() is returning 16, which iic is EBUSY). I started
digging through add_console_log(), and if I switch to an asynchronous sink
there's no issues (I suppose it doesn't need the mutex lock anymore and
that's why) My compiler's 4.8.3 on FC 20. I've tried with 1.55 and 1.56.
The code that results in the core dump:
{{{
typedef boost::log::sources::severity_logger<severity_level> lgr_type;
BOOST_LOG_GLOBAL_LOGGER(logger, lgr_type);
...
BOOST_LOG_GLOBAL_LOGGER_INIT(logger, src::severity_logger_mt)
{
// setup the console sink
typedef
boost::log::sinks::synchronous_sink<boost::log::sinks::text_ostream_backend>
text_sink;
boost::shared_ptr<text_sink> consoleSink =
boost::log::add_console_log(std::clog;
lgr_type lgr;
return lgr;
}
...
BOOST_LOG_SEV(logger::get(), SEV_LVL_TRACE) << "a message";
}}}
{{{
Thread [1] 29960 [core: 6] (Suspended : Signal : SIGABRT:Aborted)
raise() at 0x3215035c39
abort() at 0x3215037348
__assert_fail_base() at 0x321502eb96
__assert_fail() at 0x321502ec42
boost::mutex::~mutex() at mutex.hpp:108 0x7ffff7b5fb8b
boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>
>::~synchronous_sink() at sync_frontend.hpp:61 0x7ffff7b6c7af
boost::detail::sp_ms_deleter<boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>
> >::destroy() at make_shared_object.hpp:57 0x7ffff7b6c890
boost::detail::sp_ms_deleter<boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>
> >::operator() at make_shared_object.hpp:87 0x7ffff7b79dca
boost::detail::sp_counted_impl_pd<boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>
>*,
boost::detail::sp_ms_deleter<boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>
> > >::dispose() at sp_counted_impl.hpp:153 0x7ffff7b78f6d
boost::log::v2_mt_posix::core::~core() at 0x7ffff7459100
<...more frames...>
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10381> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC