Example simple_wget crashing from time to time with error:
boost thread: trying joining itself: Resource deadlock avoided
How to reproduce
I turn off wi-fi and run command:
simple_wget https://example.com/some/archive.tar.gz
Usually command exits with code 1 and message:
Saving to: archive.tar.gz
Host not found (authoritative)
which is expected and good, but sometimes application crash in libc++ with message:
libc++abi.dylib: terminating with unexpected exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >: boost thread: trying joining itself: Resource deadlock avoided
Process 75882 stopped
Backtrace can be found here
I can guess that exception which is thrown from join trigger std::terminate
because destructor has nothrow type (async_impl.h):
~async_client() throw ()
{
sentinel_.reset();
if (lifetime_thread_.get()) {
lifetime_thread_->join(); // BOOM!
lifetime_thread_.reset();
}
}
Some tests
- 5 crash from 1000 run
- 36 crash from 10000 run
Environment
- Mac OS X 10.9.1, boost 1.55 (debug build with libc++), openssl (system)
- iOS, boost 1.55 (debug build with libc++), openssl 1.0.1e
- I'm using
cpp-netlib-0.10.1, but cpp-netlib-0.11.0-rc3 has same behaviour
Also I've tried it on my virtual machine with Mac OS X 10.8.5 (which not using wi-fi),
there is no crashes.
Example
simple_wgetcrashing from time to time with error:boost thread: trying joining itself: Resource deadlock avoidedHow to reproduce
I turn off wi-fi and run command:
simple_wget https://example.com/some/archive.tar.gzUsually command exits with code 1 and message:
which is expected and good, but sometimes application crash in libc++ with message:
Backtrace can be found here
I can guess that exception which is thrown from
jointriggerstd::terminatebecause destructor has nothrow type (async_impl.h):
Some tests
Environment
cpp-netlib-0.10.1, butcpp-netlib-0.11.0-rc3has same behaviourAlso I've tried it on my virtual machine with Mac OS X 10.8.5 (which not using wi-fi),
there is no crashes.