U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
Heap Leaks on Linux when migrating to new distro and newer UPP
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45076&th=9387#msg_45076
on upp-2007.1 and Ubuntu distro 9.10
We've decided to migrate to a new Linux distribution, i.e., Linux Mint 17.2
Also, we migrated to the UPP snap shot upp-x11-src-8760.
We have been successful at compiling and linking the application after making some
minor code changes to satisfy the new compile environment and UPP.
Everything works great, except when the application exits.
We get a dialog "Fatal error" with the message "Heap leaks detected!"
This goes away if we use the project flag USEMALLOC, but this is not
the solution since it only hides a memory usage issue.
Ordinarily, development of a new program would have caught this problem
early on. The problem is that we are now looking for a needle in the haystack
because of the size of the program. Where do we look?
We've tried various memory diagnostic tools to no avail.
They give false positives, and provided no useful information.
We've tried valgrind and a few others with no relief.
On the other hand, we believe there are memory handling issues in our
application that belong to us.
These have only been discovered (or caused by) the new environment:
new compiler, linker, libraries, and UPP library.
We've tried compiling the UPP examples and tutorials and they behave properly
on exit, as does the UPP theide.
What we are faced with now is dismembering the application piece at a time and
re-compile/re-link/re-run until we discover the offending code.
What we are asking is that someone may have a better solution or alternative
method for finding the real problem to our heap leak issue. Maybe there is
something we can do to obtain more information that we don't know about.
We would welcome any help or suggestions on this matter.
Please let us know what you think.
First, if you get consistent values for --memory-breakpoint when running the application multiple times, then you can just add that as a parameter when running in debugger and it will show you where the offending piece of memmory was allocated.
Second method is to add MemmoryIgnoreLeaksBegin/End pairs around various parts of your application, until the warning stops. Then you know you found it... It is only slightly better than what you probably had in mind when you wrote about dismembering your application piece at a time, but it could save you some time and manual work
Best regards,
Honza]]>dolik.rce2015-08-27T19:52:26-00:00Re: Heap Leaks on Linux when migrating to new distro and newer UPP
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45258&th=9387#msg_45258
Additional tools were used in order to accomplish this, i.e., compile
with CLANG, and use asan.
The U++ snapshot that we are now using is upp-x11-src-9004.tar.gz
We are left with two heap leaks that we have yet to resolve.
Memory breakpoint 22748 is in our own application and we take ownership of that issue.
However, memory breakpoint 22235 is a real puzzle because it is almost exclusively is in U++ library.
Here is the log-file followed by a snapshot of the debugger call-stack:
=================
/home/svn/P101/trunk/Source/Build/upp.out/P101/CLANG.Debug.D ebug_Full.Gui.Mt.Newerupp.Noblitz.Shared.Stacktrace.X11/p101 21.10.2015 15:27:03, user: administrator
Can someone help on this particular issue?]]>jfranks2015-10-24T15:45:32-00:00Re: Heap Leaks on Linux when migrating to new distro and newer UPP
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45259&th=9387#msg_45259
This looks like the memory block is allocated when loading skin. ColoredOverride is called on CtrlsImg Images.
If you have an Image in your code that is on the heap and gets assing CtrlsImg:: image, and is leaked, you are about to get the leak you are getting. E.g.:
GUI_APP_MAIN {
Image *m = new Image;
*m = CtrlsImg::SizeGrip();
// m is not deleted and is a leak
}