[Boost-bugs] [Boost C++ Libraries] #13528: Boost Test 1.67 crashes when the --report_sink command-line parameter is used

Subject: [Boost-bugs] [Boost C++ Libraries] #13528: Boost Test 1.67 crashes when the --report_sink command-line parameter is used
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-04-18 15:50:44


#13528: Boost Test 1.67 crashes when the --report_sink command-line parameter is
used
------------------------------+-------------------------------
 Reporter: igor.akhmetov@… | Owner: Gennadiy Rozental
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.67.0 | Severity: Showstopper
 Keywords: |
------------------------------+-------------------------------
 Environment: Visual Studio 15.6, 64-bit build of Boost.

 Scenario: a Boost.Test executable crashes with an access violation when
 run with the -e command-line argument.

 Cause: Boost.Test has two global singletons, a framework::state instance
 inside s_frk_state() and a results_reporter_impl instance inside
 s_rr_impl(). Their relative destruction order is undefined, in my case the
 results_reporter_impl instance is destroyed before the framework::state
 instance. The following sequence of events then takes place:

 1) framework::state::~state destroys the m_report_sink member, leading to
 the stream_holder::~stream_holder call.

 2) stream_holder::~stream_holder destroys m_cleaner, which calls
 stream_holder::callback_cleaner::~callback_cleaner.

 3) stream_holder::callback_cleaner::~callback_cleaner calls the
 m_cleaner_callback callback, which was passed from framework::init.

 4) The callback calls results_reporter::set_stream.

 5) results_reporter::set_stream accesses the results_reporter_impl
 singleton instance, which has been already destroyed, and the program
 crashes.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13528>
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 : 2018-04-18 15:58:36 UTC