HEAP CORRUPTION DETECTED



  • 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


  • Moderators

    Does it ever happen when run in release mode?

    PS. The link you provided does not work.



  • 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


  • Moderators

    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?



  • 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?



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.