Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Getting "heap leaks detected!" error messages on program exit. How to debug it?
Re: Getting "heap leaks detected!" error messages on program exit. How to debug it? [message #3995 is a reply to message #3986] Thu, 13 July 2006 22:44 Go to previous messageGo to previous message
battika is currently offline  battika
Messages: 4
Registered: July 2006
Location: Budapest, Hungary
Junior Member
Hi Mirek,

First of all, thank you for your prompt and detailed answer. I hope you're still not running out of patience as I have some more comments. Rolling Eyes


Quote:

Now if heap leak manifests when connecting to external library, it is even more puzzling... (have you any 'new' in your code?)

Actually I started off with a "core console project". Included the Postgres library header files and added the library to the linker. Now if I comment out *everything* so only the CONSOLE_APP_MAIN section remains with the #include statement and attempt to run the program I get the same error message. So to answer your question I don't have any new()'s in my code since I don't have a code Surprised

Quote:

Anyway, for U++ based code, I usually start with looking at log file, which dumps all leaks. Quite often you can tell what the leak is just examining it.


Thank you for the tip. Again, sorry for the question but can you tell me where the log is normally located (Linux)?

Quote:

If that does not help, there is one ugly hack in heap code - you can add "memory-watch" into your APP_MAIN to catch the allocation that returns the address the leaks. (see Core/dbgheap.cpp for details - you place breakpoint there to catch). That of course helps only as long as leaking allocation for the specific address is the first one...


Cool, I will do that.

Quote:

Then of course, if everything else fails, I usually start to "minimize" code, removing part after part until leak goes away (then the bug is in the part I removed).


My code is already minimized Laughing . Probably it's time to have a look at the third-party header files.

Thanks a lot for your help again.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Again about packages
Next Topic: Problems with debugging in TheIDE (mingw)
Goto Forum:
  


Current Time: Mon Jul 07 03:35:06 CEST 2025

Total time taken to generate the page: 0.03651 seconds