Valgrind - libgtk-x11

时间:2014-12-11 03:26:52

标签: c++ qt valgrind ubuntu-14.04

我在Qt编写的程序中纠正了我的所有内存泄漏 我发现了一些无法应对的错误。

==3343== Conditional jump or move depends on uninitialised value(s)
==3343==    at 0x80B4320: g_utf8_offset_to_pointer (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==3343==    by 0x106806A0: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.23)
==3343==    by 0x10680D28: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.23)
==3343==    by 0x10C1ACE6: ??? (in /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.23)
==3343==    by 0x8086CE4: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==3343==    by 0x8087047: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==3343==    by 0x80870EB: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==3343==    by 0x64C2453: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /home/michal/Qt/5.4/gcc_64/lib/libQt5Core.so.5.4.0)
==3343==    by 0x6465DAA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /home/michal/Qt/5.4/gcc_64/lib/libQt5Core.so.5.4.0)
==3343==    by 0x646ACC4: QCoreApplication::exec() (in /home/michal/Qt/5.4/gcc_64/lib/libQt5Core.so.5.4.0)
==3343==    by 0x406317: main (main.cpp:9)</code>

我的主要功能

#include "mainwindow.hh"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec(); //this is my 9th line
}

整天试图解决它,我不知道什么是吝啬。
有人能帮助我吗?

1 个答案:

答案 0 :(得分:1)

对于您不感兴趣且无法解决问题的图书馆,您可以创建valgrind抑制文件,但不会再次显示

请参阅手册

http://valgrind.org/docs/manual/manual-core.html

第2.5节抑制错误