Re: [Boost-bugs] [Boost C++ Libraries] #13283: boost log crash during thread termination

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13283: boost log crash during thread termination
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-22 13:19:04

#13283: boost log crash during thread termination
  Reporter: Marco Strohner <marco.strohner@…> | Owner: (none)
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: None
   Version: Boost 1.66.0 | Severity: Problem
Resolution: | Keywords:
Changes (by Marco Strohner):

 * version: Boost 1.64.0 => Boost 1.66.0


 I've tested it again with boost 1.66.0 and the behaviour is the same. I
 also tried to compile boost with ''BOOST_LOG_USE_COMPILER_TLS'' but the
 behaviour is still the same.

 My results after more debugging:
 1. the logging core creates a ''thread_data'' object for the first log
 that is executed in a thread (core.cpp:open_record). This is triggered by
 the line ''BOOST_LOG_TRIVIAL(warning) << "Destroy event #" << i;''
 2. This created ''thread_data'' object ist added to the ''tss_node'' map
 for automatic cleanup after thread execution is finished.
 3. After the thread execution is finished the ''tls_destructor'' is called
 (thread.cpp:thread_proxy). This ''tls_destructor'' destroys the in step 1
 created ''thread_data'' object
 4. When the method ''thread_proxy'' is finished the reference counter of
 the lambda parameter ''event'' is decreased and the destructor is called.
 5. The destructor tries to log one line (BOOST_LOG_TRIVIAL(warning) <<
 "crashes here";). But the method ''get_thread_data'' still returns the
 already destroyed pointer to the ''thread_data'' object.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-03-22 13:23:30 UTC