New issue 287 by jenge...@live.ca: Memory leaks reported after
ShutdownProtobufLibrary and program exit.
http://code.google.com/p/protobuf/issues/detail?id=287
What steps will reproduce the problem?
1. Create an application that includes any protobuf definition header.
2. Link statically with protobuf; you do not need to actually use any
protobuf functions/objects.
3. Set up memory leak detection with #define _CRTDBG_MAP_ALLOC and call
_CrtDumpMemoryLeaks after calling ShutdownProtobufLibrary.
What is the expected output? What do you see instead?
Several memory leak detections such as:
{139} normal block at 0x00194E68, 24 bytes long.
Data: <hh > 68 68 87 00 FF FF FF FF 00 00 00 00 00 00 00 00
What version of the product are you using? On what operating system?
2.4.0a on Windows 7 with Visual Studio 2010 Express Edition
Please provide any additional information below.
Not a huge deal considering I've isolated that it is in fact the library
that is creating the 'leak', but now I can't determine whether other leaks
are coming from my program or the library.
I've seen other reports of the same issue, but people mentioned that
ShutdownProtobufLibrary was implemented to handle that, but it doesn't help
in this basic program.
We use tcmalloc heap check for memory leak detection before each release.
Normally there will be some "leak" in system library.. Do you have debug
dump that shows the leaking symbol / stack traces?
I figured they weren't actual leaks in the library itself, but I'm
wondering if there's a way to clean it all up before the program exits so I
can properly diagnose whether the application itself has leaks.
I can't get any dumps besides output in the form that I mentioned in the
expected output. I can't get break points on those allocation numbers
either, so I can't see which data it's actually referring to.
If it's any help, I believe this issue
(http://code.google.com/p/protobuf/issues/detail?id=54) is the same, only
the fix that was ultimately implemented doesn't seem to solve the issue in
this case.
I'd love to see a method that clears and releases everything, even if it
completely shuts down the library in the process.