Boost logo

Boost Users :

Subject: Re: [Boost-users] Problems with boost 1.44.0 and MSVC: boost::mutex::scoped_lock and std::deque in multithreaded application
From: Igor R (boost.lists_at_[hidden])
Date: 2010-10-05 05:37:35


2010/10/5 Yana A Kireyonok (aka Iron Bug) <death.iron.bug_at_[hidden]>:
> Greetings, ppl.
> I've got strange problems with the latest stable boost (1.44.0) and
> MSVS studios 2005 and 2010.
>
> The first problem I got (it seems being not dependent on boost
> version) was the heap allocation exception when using
> mutex::scoped_lock to guard references to std::deque from different
> threads in multithreaded application.

According to your description, it seems that the issue you encountered
is only a symptom of some memory-management issue in your code: you've
got a damaged heap at the point where scoped_lock tries to allocate
memory. You can use MSVC heap debugging facilities to try and spot the
problem: http://msdn.microsoft.com/en-us/library/974tc9t1.aspx .
Besides, it worth checking that you never delete objects through a
pointer to base-case (directly or using smart-ptrs), if they don't
have virtual d-tor. This kind of bug ruins the heap immediately, but
it's quite hard to locate it using the above heap-debugging
techniques.


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