Note that there are some explanatory texts on larger screens.

plurals
  1. POboost::shared_ptr's destructor block the only thread
    primarykey
    data
    text
    <p>I'm porting a C++ program from FreeBSD to RHEL. When I test my program, I found the process will hang when call boost::shared_ptr::~shared_ptr(). </p> <p>I use gdb to attach the hanging process, and the stack trace is :</p> <pre><code>(gdb) bt #0 0x00e01430 in __kernel_vsyscall () #1 0x00bd8d96 in __pause_nocancel () from /lib/libpthread.so.0 #2 0x00bd30b2 in __pthread_mutex_lock_full () from /lib/libpthread.so.0 #3 0x04a60a26 in pthread_mutex_lock () from /lib/libc.so.6 #4 0x08069b61 in boost::detail::lightweight_mutex::scoped_lock::scoped_lock(boost::detail::lightweight_mutex&amp;) () #5 0x080699d3 in boost::detail::sp_counted_base::release() () #6 0x08069999 in boost::detail::shared_count::~shared_count() () #7 0x08069952 in boost::shared_ptr&lt;SS::Conf::SSConfNode&gt;::~shared_ptr() () #8 0x00124fde in SS::Conf::SSConfManager::createConfFile(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) () from /home/y/lib/libSS_conf.so.1 #9 0x00125e0c in SS::Conf::SSConfManager::createAllConfFiles() () from /home/y/lib/libSS_conf.so.1 #10 0x0012946b in SS::Conf::SSConfManager::initFromDisk(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) () from /home/y/lib/libSS_conf.so.1 #11 0x00129c3b in SS::Conf::SSConfManager::configure(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) () from /home/y/lib/libSS_conf.so.1 #12 0x00156d0c in SS::Init::configure() () from /home/y/lib/libSS_init.so.1 #13 0x0805ac63 in SS::Main::init() () #14 0x0807117e in main () </code></pre> <p>And my process only contains one thread:</p> <pre><code>(gdb) info thread * 1 Thread 0xf77a8a40 (LWP 16724) 0x00c54430 in __kernel_vsyscall () </code></pre> <p>When I <strong>undef</strong> BOOST_HAS_THREADS in header file and rebuild the program, everything goes well. </p> <p>The boost version is 1.32,I'm using gcc 3.4.6-11 on RHEL4.8. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload