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

Paul Grenyer paul at paulgrenyer.co.uk
Sun Mar 28 12:32:18 CEST 2004


Hi

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

Absolutely. As I've already mentioned, I was not asking for help on this
point. I left some test running on Friday when I left work so that I can
post the exact errors tomorrow.

>  > 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.

Right.

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

Yes.

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

Ok, without going into our system in too much depth. Our main "application"
is an ATL COM server which hosts a number of COM objects. The COM wrappers
are completely seperated from the "back-end processing" that they provide.
Each peice of backend processing is contained in a static library (this also
allows us to test each piece in isolation).

We're using boost.python to make the back-end processing available to anyone
wanting to write a python script and take advantage of the pieces. Therefore
the static libs must be linked into both the ATL COM server and the
boost.python extension DLL. This can't be done in a single project if the
server and the dll are using different runtimes.

> > 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.

Ok.

>  > Is anything being done to fix it?
>
> Not by me.  I don't have a clue where it is.

Fair enough. :-)

> > is it worth posting about it to the main boost list?
>
> Sure; first I'd try to reproduce the problem with a minimal example.

Well, as I think I put in my original post, the memory leak occurs even when
a program contains only a handle declaration. However, I don't know if this
is the post-Py_Finalize memory leak or the growing memory leak I have been
experiencing, but it is present in the dll runtime and not in the static
runtime.

Regards
Paul

Paul Grenyer
Email: paul at paulgrenyer.co.uk
Web: http://www.paulgrenyer.co.uk

Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now ready for download





More information about the Cplusplus-sig mailing list