Opened 2 months ago

Last modified 8 weeks ago

#13528 assigned Bugs

Boost Test 1.67 crashes when the --report_sink command-line parameter is used

Reported by: igor.akhmetov@… Owned by: Raffi Enficiaud
Milestone: To Be Determined Component: test
Version: Boost 1.67.0 Severity: Showstopper
Keywords: Cc:


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.

Attachments (0)

Change History (1)

comment:1 Changed 8 weeks ago by Raffi Enficiaud

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

Modify Ticket

Change Properties
Set your email in Preferences
as assigned The owner will remain Raffi Enficiaud.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.