[threads] Memory leaks in Boost threading support? Version boost_1_53_0
I am running a number of Boost threads communicating via bounded
buffers. My programs seem to run properly, but I get a number of memory
leaks, usually 4- and 8- byte areas, although a few are longer. As far
as I can tell, they are coming from inside Boost, as there is no mention
of lines in my code. OTOH, although my code runs fine, it is quite
possible that there are subtle errors in it!
I am using _CRTDBG_MAP_ALLOC, which is being used correctly as it
detected one area of my own that I was not freeing up, and that has been
fixed.
I am running VC++ 2010 Express on a 64-bit machine.
Here is my memory leak display - I tried setting a few of the numbers as
breakpoints, using_CrtSetBreakAlloc(), but most of them did not cause
breaks.
The first one broke at a new in >
boost::detail::basic_condition_variable::get_wait_entry() Line 180 + 0x7
bytes C++
Why wouldn't this get freed up?!
Note: <bad exception > looks ominous - where is it coming from?!
Detected memory leaks!
Dumping objects ->
{8624} normal block at 0x02312550, 4 bytes long.
Data: <HC1 > 48 43 31 02
{8615} normal block at 0x0015F8F8, 4 bytes long.
Data:
Le 14/09/13 03:42, Paul Morrison a écrit :
I am running a number of Boost threads communicating via bounded buffers. My programs seem to run properly, but I get a number of memory leaks, usually 4- and 8- byte areas, although a few are longer. As far as I can tell, they are coming from inside Boost, as there is no mention of lines in my code. OTOH, although my code runs fine, it is quite possible that there are subtle errors in it!
I am using _CRTDBG_MAP_ALLOC, which is being used correctly as it detected one area of my own that I was not freeing up, and that has been fixed.
I am running VC++ 2010 Express on a 64-bit machine.
Here is my memory leak display - I tried setting a few of the numbers as breakpoints, using_CrtSetBreakAlloc(), but most of them did not cause breaks.
The first one broke at a new in > boost::detail::basic_condition_variable::get_wait_entry() Line 180 + 0x7 bytes C++
Why wouldn't this get freed up?!
Note: <bad exception > looks ominous - where is it coming from?!
Hi,
the issue seems to be introduced in changeset
https://svn.boost.org/trac/boost/changeset/40478 improved lifetime
management of thread data.
-
- struct externally_launched_thread_deleter
- {
- externally_launched_thread* thread_data;
-
- externally_launched_thread_deleter(externally_launched_thread* thread_data_):
- thread_data(thread_data_)
- {}
-
- void operator()() const
- {
- intrusive_ptr_release(thread_data);
- }
- };
-
- }
-
+ }
thread thread::self()
@@ -156,5 +185,4 @@
externally_launched_thread* me=detail::heap_new
Le 14/09/13 15:24, Vicente J. Botet Escriba a écrit :
Le 14/09/13 03:42, Paul Morrison a écrit :
The first one broke at a new in > boost::detail::basic_condition_variable::get_wait_entry() Line 180 + 0x7 bytes C++
Why wouldn't this get freed up?!
Note: <bad exception > looks ominous - where is it coming from?!
Hi,
the issue seems to be introduced in changeset https://svn.boost.org/trac/boost/changeset/40478 improved lifetime management of thread data.
<snip>
I would need some time to analyze the changes.
Please could you create a Trac ticket?
Best, Vicente
Forget my message. It has nothing to be with condition_variable :( Vicente
participants (2)
-
Paul Morrison
-
Vicente J. Botet Escriba