Boost logo

Boost Users :

Subject: [Boost-users] [Thread] Assert after reloading multiple times a .so linked with the static build of Boost.Thread
From: Sorin Fetche (sorin.fetche_at_[hidden])
Date: 2011-05-11 08:07:15


Hi,

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). Does this show a valid bug in
a supported usage pattern?

./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

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

This approach has been taken in order to allow different modules using
different versions of Boost to get (re)loaded in the same plugin-based
application and has been inspired by this discussion:
http://lists.boost.org/Archives/boost/2005/09/94134.php

Thank you,
Sorin Fetche







Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net