Memory dump on exit



  • Hi,
    my program is working, but I guess I've got a dangling pointer or something like that since when I quit the application the following dump is produced on the console:

    @*** glibc detected *** /sviluppo/c/WHR-build-desktop/WHR: corrupted double-linked list: 0x0000000001f60720 ***
    ======= Backtrace: =========
    /lib/libc.so.6(+0x774b6)[0x7f4bb51204b6]
    /lib/libc.so.6(+0x7a921)[0x7f4bb5123921]
    /lib/libc.so.6(cfree+0x73)[0x7f4bb5126c83]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(+0x68a96d)[0x7f4bb692296d]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(+0x68b11b)[0x7f4bb692311b]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN7QObjectD2Ev+0x54c)[0x7f4bb5f7bccc]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x33b)[0x7f4bb64e79fb]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN7QTabBarD0Ev+0x21)[0x7f4bb6919b51]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x7f)[0x7f4bb5f745bf]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x278)[0x7f4bb64e7938]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN10QTabWidgetD0Ev+0x21)[0x7f4bb6923881]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x7f)[0x7f4bb5f745bf]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x278)[0x7f4bb64e7938]
    /sviluppo/c/WHR-build-desktop/WHR[0x41da53]
    /sviluppo/c/WHR-build-desktop/WHR[0x420ad1]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN7QObject5eventEP6QEvent+0x3b8)[0x7f4bb5f74468]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN7QWidget5eventEP6QEvent+0x4f)[0x7f4bb64e1e9f]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0xac)[0x7f4bb648c39c]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x14d)[0x7f4bb6492bdd]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x8c)[0x7f4bb5f623bc]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x323)[0x7f4bb5f65383]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(+0x1a6e93)[0x7f4bb5f8ee93]
    /lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f2)[0x7f4bb389e342]
    /lib/libglib-2.0.so.0(+0x442a8)[0x7f4bb38a22a8]
    /lib/libglib-2.0.so.0(g_main_context_iteration+0x6c)[0x7f4bb38a245c]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x73)[0x7f4bb5f8e9d3]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4(+0x2a76fe)[0x7f4bb653f6fe]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x32)[0x7f4bb5f610e2]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xdc)[0x7f4bb5f614cc]
    /usr/local/Trolltech/Qt-4.7.4/lib/libQtCore.so.4(_ZN16QCoreApplication4execEv+0xbb)[0x7f4bb5f655bb]
    /sviluppo/c/WHR-build-desktop/WHR[0x409f60]
    /lib/libc.so.6(__libc_start_main+0xfe)[0x7f4bb50c7d8e]
    /sviluppo/c/WHR-build-desktop/WHR[0x409e39]
    @

    The point is, how can I find where the problem is?



  • First step would be to build in debug mode and run the application through the debugger. This way you get a backtrace that brings you to the line that causes the trouble.

    On first sight, the memory corruption looks like an object that is deleted twice.



  • You can also use a valgrind - tool for investigating leaks. You can also try a cppcheck - this tool is for static code analize.


Log in to reply
 

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