[Thread] program crashes from time to time when deleting unique_future<void>
Hi,
I have a small example program that crashes from time to time.
I would appreciate some help to understand why.
In function run() executed on the main thread I create a packaged_task (pt), put it in a queue (_q) and wait for it to get executed (fu.get()).
In another thread the tasks are executed when the queue _q is populated.
The task I'm running always throws/rethrows intentionally.
It results (from time to time) in an access violation when the unique_future, fu, is deleted.
See the stack trace at the bottom.
Anybody see any flaws in this design?
I have tried 1.47.0 and 1.48.0, MSVC 2005.
Here's the code.
*****************************************************
#include
crasher.exe!boost::exception_detail::refcount_ptrboost::exception_detail::error_info_container::release() Line 78 + 0x18 bytes C++
crasher.exe!boost::exception_detail::refcount_ptrboost::exception_detail::error_info_container::~refcount_ptrboost::exception_detail::error_info_container() Line 35 C++
crasher.exe!boost::exception::~exception() Line 278 + 0xb bytes C++
crasher.exe!boost::exception_detail::clone_impl<TheException>::`vbase destructor'() + 0x41 bytes C++
crasher.exe!boost::exception_detail::clone_impl<TheException>::`scalar deleting destructor'() + 0x2b bytes C++
crasher.exe!boost::checked_delete
On Mon, Nov 21, 2011 at 8:40 AM, Soderback, Johan
Hi,
I have a small example program that crashes from time to time.
I would appreciate some help to understand why.
Your program ended up with a copy of an exception object, which shared internal state with the original, but the original and the copy were in different threads. There is special machinery in Boost Exception which should have prevented that situation. There was a bug in that system. I think it's fixed now, see trunk revision number 75636. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Emil Dotchevski Sent: den 23 november 2011 09:57
There was a bug in that system. I think it's fixed now, see trunk revision number 75636.
Hi Emil, Yes it solves it, thanks for fixing the problem so quickly! /Johan Please consider the environment before printing this e-mail. The contents of this e-mail message (including any attachments) are confidential to and are intended to be conveyed for the use of the recipient to whom it is addressed only. If you receive this transmission in error, please notify the sender of this immediately and delete the message from your system. Any distribution, reproduction or use of this message by someone other than recipient is not authorized and may be unlawful.
participants (2)
-
Emil Dotchevski
-
Soderback, Johan