Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » C / C++ (ANSI-Standard) » heap overflow detection

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
000
13.10.2008, 17:47 Uhr
~luckyluke
Gast


Hi,

I have been working on a large C++ project (STL) and have been running the executbale in the Debug Mode (compiled by VS2003).
During runtime I notice an error in the console window which says "Heap overflow". There is no Abort-Retry crash window and no other information available.

1. How can I isolate the heap overflow location?
2. Is there a way that can result this "Heap oveflow" error to cause an Abort-Retry to happen so that I can trace the call stack?

Greets,
Michael
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
13.10.2008, 20:54 Uhr
ao

(Operator)


Hi, this is an issue that needs some expertise. If you are a newbie, you better get some help at your place.

First, make sure it actually is a heap overflow and not in some other way corrupted memory. Check the memory consumption in the Task Manager while the program is running. Are you really using up the memory?

If yes, try to find unbalanced malloc/free or new/delete pairs. There are numerous ways to lose memory.

Check for correct usage of delete and delete[].

Check if all dynamically fetched class members are well deleted, in all possible cases (destructor, assignment operator, other methods that replace a memory region). If you re-allocate memory for a pointer member and an old memory region exists, you must first delete it.

If you have derived classes: Are the destructors virtual? If not, base class destructors are not called, and if the base class allocates memory, it will be lost.

I guess you could also run lint on the source code, to detect the memory leak statically. Sorry I'm not the lint expert, but there are others around here who are.

Good luck
ao
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ C / C++ (ANSI-Standard) ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: