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 » valgrind problem, heap-leak debugging
valgrind problem, heap-leak debugging [message #44252] Fri, 13 February 2015 08:05 Go to next message
slashupp is currently offline  slashupp
Messages: 193
Registered: July 2009
Experienced Member
Running my app ends with "Heap-leaks detected".

I don't do "new" anywhere, so there is no obvious place to start looking for the problem.

So I try [Debug/Test with Valgrind] and get a huge amount of output.
This is not helpful.

1. Is there a way I can force valgrind to just focus on my app and ignore upp-sources?

2. What other ways can I use to find the cause of the heap-leak?

---
PS: .. to maybe help others with same kind of problem ..
I've found the cause: needed a virtual dtor in a struct I was using, added it and the heap-leaks went away.
How I found it: Searched SO and found this answer [http://stackoverflow.com/a/2480641/15161]:
Quote:
[..] code that creates your object on the heap. It would be bad practice for your class to assume that it is always going to be created on the stack...

My struct is defined within a class and instances are created, used and passed as parameters
all over the place (without the SO-clue (and only with this dysfunctional valgrind-hook) it would have
been a real mission to find)

The two questions I think remains valid and any answers would be helpful for the future.

[Updated on: Fri, 13 February 2015 09:12]

Report message to a moderator

Re: valgrind problem, heap-leak debugging [message #44253 is a reply to message #44252] Fri, 13 February 2015 10:09 Go to previous message
mirek is currently offline  mirek
Messages: 12096
Registered: November 2005
Ultimate Member
[quote title=slashupp wrote on Fri, 13 February 2015 08:05]Running my app ends with "Heap-leaks detected".

I don't do "new" anywhere, so there is no obvious place to start looking for the problem.

So I try [Debug/Test with Valgrind] and get a huge amount of output.
This is not helpful.

1. Is there a way I can force valgrind to just focus on my app and ignore upp-sources?

2. What other ways can I use to find the cause of the heap-leak?

---
PS: .. to maybe help others with same kind of problem ..
I've found the cause: needed a virtual dtor in a struct I was using, added it and the heap-leaks went away.
[/code]

Yeah, with U++, memory leaks are caused by missing virtual destructor in 95% of cases. Happens to me too.

BTW, U++ has a quite good way to resolve memory leaks:

http://www.ultimatepp.org/srcdoc$Core$Leaks$en-us.html
Previous Topic: Cannot Compile TheIDE with MSVC12
Next Topic: umk fails on launchpad
Goto Forum:
  


Current Time: Tue Nov 12 12:22:21 CET 2019

Total time taken to generate the page: 0.01337 seconds