[C++-sig] Re: MSVC 7.1 Multithreaded Dll Memory Leak [long post]

David Abrahams dave at boost-consulting.com
Sun Mar 28 07:23:44 CEST 2004

"Paul Grenyer" <paul at paulgrenyer.co.uk> writes:

> Hi
>> I am currently running all our unit tests with the static 
>> multithreaded runtime. If they pass then we may well switch to that 
>> for the time being, but I would prefer to fix the problem and keep 
>> using the dll multithreaded runtime.
> I'm not sure how relevant to most people this post will be, but for 
> those of you that are interested....
> All of our C++ unit tests, including those that use the embedded Python 
> interpretter ran successfully when linked against the static runtime, 
> with one exception (pun intended) where an exception was thrown due to 
> an invalid string position. That should be an easy fix and this 
> exercise has hopefully thrown up a bug I can fix.
> However, all of our boost python extensions (I didn't write the stuff 
> and I'm not sure of the right terminology. I mean C++ code wrapped in 
> boost python to expose it to python) failed with unknown C++ errors or 
> something similar. 

"Unknown C++ Error" is a pretty vague term.  Almost anything could be
considered to be similar to that.

> I suspect this is due to the fact that they are Dlls 
> and therefore presumably need the Dll runtime.

DLLs don't require the dynamic runtime library, but extensions linked
to Python might require it.

> Ah! I thought, build everything with the static runtime except the 
> boost python extensions. No! The boost pythong extensions use other

 "static" here
> libraries in our system that have already been built with the static 
> runtime, so they fail to link.


> So, I'm stuck with either having to do two different builds to build 
> our whole system (not nice. espcially when you have one large project 
> capable of building and running all tests) or try to get the memory 
> leak fixed.
> Dave, is this memory leak a recognised problem? 

I recognize that some people are reporting something, but I don't know
anything more about it.

> Is anything being done to fix it? 

Not by me.  I don't have a clue where it is.

> As the problem is in function.hpp

I think it's probably too early to draw that conclusion, but...

> is it worth posting about it to the main boost list?

Sure; first I'd try to reproduce the problem with a minimal example.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list