HEAP CORRUPTION DETECTED
-
wrote on 17 Jul 2012, 11:32 last edited by
Hi all,
I use Qt 4.8.2 libraries compiled with VS2008 and Qt Creator 2.4.1 on Windows 7 host machine. My project settings uses Microsoft Visual C++ Compiler 9.0 (x86) as tool chain.
I start my application at debug mode on Qt Creator. Sometimes it throws "HEAP CORRUPTION DETECTED" error when I close the application. This error occurs always while closing after one time occurs until I start it with clean build. After clean build, this error does not occur for a uncertain time.
I've read a bug report at link https://bugreports.qt-project.org/browse/QTBUG-24741 . Is there anyone encountered with such problem? What can be the problem?
Thanks advance for your helps and explanations,
Yasemin -
Does it ever happen when run in release mode?
PS. The link you provided does not work.
-
wrote on 18 Jul 2012, 07:46 last edited by
Sorry about late answer because the error occurs randomly, sometimes it takes a long time. I've tried in release mode and it does not crash in release mode. As according to you, why does this error occur in debug mode? Is the problem related to Qt or my code or else?
Thanks a lot for your helps
-
wrote on 18 Jul 2012, 08:01 last edited by
IMHO it may be a problem of the compiler tool chain. However, if it does produce the error in debug, but not in release mode, is not a sufficient prove. Mysterious problems such this are often triggered by some less optimal code lines. Did you take care of all warnings and eliminated them in your code? Sometimes a different compiler will provide different warnings. Did you try with another compiler and check its warnings?
-
wrote on 18 Jul 2012, 15:49 last edited by
Kidding: Sometimes the error lies between both ears, where someone does strange things on the heap. But maybe I can only speak for myself.
Please also have a look at your own code. What are you doing with the heap and when or where are the objects destroyed you've allocated?
-
wrote on 19 Jul 2012, 14:09 last edited by
You will see the error concerning heap corruption in debug builds because heap checking is being carried out when freeing memory only in the debug C++ runtime libraries.
Usual causes are writing past the end of an array you've allocated on the heap, using delete / delete [] wrongly etc.
4/6