Opened 11 years ago

Closed 9 years ago

#5535 closed Bugs (duplicate)

Assert after reloading multiple times a .so linked with the static build of Boost.Thread

Reported by: sorin.fetche@… Owned by: Anthony Williams
Milestone: To Be Determined Component: thread
Version: Boost 1.46.1 Severity: Problem
Keywords: module leak Cc:

Description

The attached test program shows that after a few hundred reloads of a shared library linked with the static build of Boost.Thread, an assert will be raised (gcc 4.4; boost 1.46.1).

As a note, the test program demonstrates the usage of a shared library that exposes a C interface and is implemented using statically linked Boost libraries.

Test program output:

./a.out Call: 0 Call: 100 Call: 200 Call: 300 Call: 400 Call: 500 a.out: /home/sfetche/local/boost/src/boost_1_46_1/boost/thread/pthread/condition_variable_fwd.hpp:46: boost::condition_variable::~condition_variable(): Assertion `!pthread_mutex_destroy(&internal_mutex)' failed. Aborted

Attachments (1)

test_program.zip (1.9 KB ) - added by sorin.fetche@… 11 years ago.

Download all attachments as: .zip

Change History (6)

by sorin.fetche@…, 11 years ago

Attachment: test_program.zip added

comment:1 by viboes, 11 years ago

Keywords: module added

comment:2 by viboes, 11 years ago

Keywords: leak added

comment:3 by Sorin Fetche <sorin.fetche@…>, 9 years ago

In case it helps, the problem can be avoided, at least in boost 1.51, by compiling Boost.Thread with BOOST_THREAD_PATCH defined. That's because a fix for the issue is in the code already but is not enabled by default.

If it doesn't cause any side effects, could this fix be enabled by default?

comment:4 by viboes, 9 years ago

The patch was suggested for #3926, but as discussed on this ticket the patch is not enough.

comment:5 by viboes, 9 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.