Opened 9 years ago

Closed 9 years ago

#9868 closed Bugs (duplicate)

boost1.55-program crashes on exit when boost 1.55 is used

Reported by: anonymous Owned by: Andrey Semashev
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

Hi, I have this exe using the previous versions of boost working fine. When I updated boost library to Boost 1.55, my application crashes on exit with the following message: ./boost/smart_ptr/detail/lwm_pthreads.hpp:73: boost::detail::lightweight_mutex::scoped_lock::scoped_lock(boost::detail::lightweight_mutex&): Assertion `pthread_mutex_lock( &m_ ) == 0' failed. Aborted I have attached the stack trace with this.

Change History (3)

comment:1 by anonymous, 9 years ago

For some reasons, i could not attach the stacktrace file. Here is the stack trace i have: (gdb) backtrace #0 0x4022fe08 in raise () from /lib/libc.so.6 #1 0x4023398c in abort () from /lib/libc.so.6 #2 0x40228adc in ?? () from /lib/libc.so.6 #3 0x40228ba4 in assert_fail () from /lib/libc.so.6 #4 0x002da2ec in boost::detail::lightweight_mutex::scoped_lock::scoped_lock (

this=0xbefff8c8, m=...) at ./boost/smart_ptr/detail/lwm_pthreads.hpp:73

#5 0x0030612c in boost::atomics::detail::lockpool::scoped_lock::scoped_lock (

this=0xbefff8c8, addr=0x3fe304 <boost::detail::(anonymous namespace)::current_thread_tls_init_flag>) at ./boost/atomic/detail/lockpool.hpp:36

#6 0x003061b4 in boost::atomics::detail::base_atomic<unsigned int, int, 4u, false>::load (

this=0x3fe304 <boost::detail::(anonymous namespace)::current_thread_tls_init_flag>) at ./boost/atomic/detail/base.hpp:294

#7 0x00305d94 in boost::thread_detail::enter_once_region (flag=...)

at libs/thread/src/pthread/./once_atomic.cpp:38

#8 0x0030217c in boost::call_once<void (*)()> (flag=...,

f=0x2fe73c <boost::detail::(anonymous namespace)::create_current_thread_tls_key()>) at ./boost/thread/pthread/once_atomic.hpp:145

#9 0x002fe79c in boost::detail::get_current_thread_data ()

at libs/thread/src/pthread/thread.cpp:140

#10 0x002ffd08 in boost::detail::find_tss_data (key=0x3ff278)

at libs/thread/src/pthread/thread.cpp:679

---Type <return> to continue, or q <return> to quit---return #11 0x002fff6c in boost::detail::set_tss_data (key=0x3ff278, func=...,

tss_data=0x0, cleanup_existing=true) at libs/thread/src/pthread/thread.cpp:722

#12 0x00278750 in boost::thread_specific_ptr<boost::log::v2s_mt_posix::core::implementation::thread_data>::~thread_specific_ptr (this=0x3ff278,

in_chrg=<optimized out>) at ./boost/thread/tss.hpp:79

#13 0x00278014 in boost::log::v2s_mt_posix::core::implementation::~implementation (this=0x3ff240, in_chrg=<optimized out>) at libs/log/src/core.cpp:184 #14 0x00275490 in boost::log::v2s_mt_posix::core::~core (this=0x3ff230,

in_chrg=<optimized out>) at libs/log/src/core.cpp:416

#15 0x0027af90 in boost::checked_delete<boost::log::v2s_mt_posix::core> (

x=0x3ff230) at ./boost/checked_delete.hpp:34

#16 0x0027b5c4 in boost::detail::sp_counted_impl_p<boost::log::v2s_mt_posix::core>::dispose (this=0x3ff760) at ./boost/smart_ptr/detail/sp_counted_impl.hpp:78 #17 0x00049698 in boost::detail::sp_counted_base::release (this=0x3ff760)

at /home/UTILS/pre/boost_1_55_0/boost/smart_ptr/detail/sp_counted_base_spin.hpp:103

#18 0x00049738 in boost::detail::shared_count::~shared_count (

this=0x3fdd48 <boost::log::v2s_mt_posix::aux::lazy_singleton<boost::log::v2s_mt_posix::core::implementation, boost::shared_ptr<boost::log::v2s_mt_posix::core> >::get_instance()::instance+4>, in_chrg=<optimized out>) at /home/UTILS/pre/boost_1_55_0/boost/smart_ptr/detail/shared_count.hpp:371

---Type <return> to continue, or q <return> to quit---return #19 0x000c48e8 in boost::shared_ptr<boost::log::v2s_mt_posix::core>::~shared_ptr (

this=0x3fdd44 <boost::log::v2s_mt_posix::aux::lazy_singleton<boost::log::v2s_mt_posix::core::implementation, boost::shared_ptr<boost::log::v2s_mt_posix::core> >::get_instance()::instance>, in_chrg=<optimized out>) at /home/UTILS/pre/boost_1_55_0/boost/smart_ptr/shared_ptr.hpp:328

#20 0x402352fc in ?? () from /lib/libc.so.6 #21 0x40235334 in exit () from /lib/libc.so.6 #22 0x4021a288 in libc_start_main () from /lib/libc.so.6 #23 0x00037e30 in _start () (gdb) exit

comment:2 by Peter Dimov, 9 years ago

Owner: changed from Peter Dimov to Andrey Semashev

This is a known problem with the Boost.Atomic lock pool - see #9466. The comments on that ticket contain a fix.

comment:3 by Andrey Semashev, 9 years ago

Resolution: duplicate
Status: newclosed

Duplicates #9466.

Note: See TracTickets for help on using tickets.