|
From: Anisha K. <bor...@gm...> - 2012-12-05 09:09:00
|
Greetz, Using C++, Qt 4.7, openSUSE 11.4, Valgrind, GCC Actually this application runs very fine on Linux, but "crashes" on Windows if I "move the mouse wheel". I have NOT written any event for wheel handling in the code. So, I was thinking that I should dig in the memory leaks etc, and now I don't know what to make out of the following Valgrind's output. Valgrind shows tons of errors pointing to Qt's source files, but not to my source files! Please explain what to make out of this. The Makefile gets auto generated by qmake. It DOES contain the -Wall. Make does NOT show any warnings to me. The problem is that the functions pointed out by Valgrind are NO where in my code. I haven't used functions like - `createObject`, `setContent` etc. anywhere. They look like internal Qt functions. How to know whether problem is in my code or not? `valgrind --leak-check=full -v offline` results in: ********************************************************************* -6491-- Reading syms from /home/.../offline/offline (0x400000) --6491-- Reading syms from /lib64/ld-2.11.3.so (0x4000000) --6491-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000) --6491-- object doesn't have a symbol table --6491-- object doesn't have a dynamic symbol table --6491-- Reading suppressions file: /usr/lib64/valgrind/default.supp --6491-- REDIR: 0x4015fc0 (strlen) redirected to 0x38042017 (???) --6491-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4a20000) --6491-- object doesn't have a symbol table --6491-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c22000) --6491-- object doesn't have a symbol table ==6491== WARNING: new redirection conflicts with existing -- ignoring it --6491-- new: 0x04015fc0 (strlen ) R-> 0x04c26ee0 strlen --6491-- REDIR: 0x4015f10 (index) redirected to 0x4c26b40 (index) --6491-- REDIR: 0x4015f90 (strcmp) redirected to 0x4c274e0 (strcmp) --6491-- Reading syms from /usr/lib64/R/lib/libR.so (0x4e2c000) ..... --6491-- Reading syms from /home/anisha/qtsdk-2010.05/qt/lib/libQtGui.so.4.7.0 (0x5e43000) --6491-- Reading syms from /home/anisha/qtsdk-2010.05/qt/lib/libQtCore.so.4.7.0 (0x6bc0000) --6491-- Reading syms from /lib64/libpthread-2.11.3.so (0x70a3000) --6491-- Reading syms from /usr/lib64/libstdc++.so.6.0.14 (0x72c0000) --6491-- object doesn't have a symbol table --6491-- Reading syms from /lib64/libm-2.11.3.so (0x75c9000) --6491-- Reading syms from /lib64/libgcc_s.so.1 (0x7820000) --6491-- Considering /usr/lib/debug/.build-id/e6/eb8011838a065946e5808e036550844548379f.debug .. --6491-- .. build-id is valid --6491-- Reading syms from /lib64/libc-2.11.3.so (0x7a36000) --6491-- Reading syms from /lib64/libreadline.so.6.1 (0x7da3000) --6491-- object doesn't have a symbol table --6491-- Reading syms from /lib64/librt-2.11.3.so (0x7fea000) --6491-- Reading syms from /lib64/libdl-2.11.3.so (0x81f3000) --6491-- Reading syms from /usr/lib64/libgomp.so.1.0.0 (0x83f7000) ==6491== 5 errors in context 13 of 34: ==6491== Conditional jump or move depends on uninitialised value(s) ==6491== at 0x611629E: QHash<unsigned int, int>::findNode(unsigned int const&, unsigned int*) const (../include/QtCore/../../src/corelib/tools/qhash.h:884) ==6491== by 0x62E9AC6: QTextFormatCollection::indexForFormat(QTextFormat const&) (../include/QtCore/../../src/corelib/tools/qhash.h:865) ==6491== by 0x62E9E51: QTextFormatCollection::createObjectIndex(QTextFormat const&) (/var/tmp/qt-src/src/gui/text/qtextformat.cpp:3142) ==6491== by 0x62FF56E: QTextDocumentPrivate::createObject(QTextFormat const&, int) (/var/tmp/qt-src/src/gui/text/qtextdocument_p.cpp:1588) ==6491== by 0x62FFD57: QTextDocumentPrivate::rootFrame() const (/var/tmp/qt-src/src/gui/text/qtextdocument_p.cpp:1407) ==6491== by 0x63203B0: QTextDocumentLayout::doLayout(int, int, int) (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:2908) ==6491== by 0x632051C: QTextDocumentLayoutPrivate::ensureLayoutedByPosition(int) const (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:3076) ==6491== by 0x6320978: QTextDocumentLayoutPrivate::layoutStep() const (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:3082) ==6491== by 0x632123C: QTextDocumentLayout::documentChanged(int, int, int) (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:2874) ==6491== by 0x62EF7D3: QTextDocument::documentLayout() const (/var/tmp/qt-src/src/gui/text/qtextdocument.cpp:1070) ==6491== by 0x62C0D36: QTextControlPrivate::_q_documentLayoutChanged() (/var/tmp/qt-src/src/gui/text/qtextcontrol.cpp:624) ==6491== by 0x62C104E: QTextControlPrivate::setContent(Qt::TextFormat, QString const&, QTextDocument*) (/var/tmp/qt-src/src/gui/text/qtextcontrol.cpp:434) ==6491== 3 errors in context 10 of 34: ==6491== Use of uninitialised value of size 8 ==6491== at 0x6116276: QHash<unsigned int, int>::findNode(unsigned int const&, unsigned int*) const (../include/QtCore/../../src/corelib/tools/qhash.h:884) ==6491== by 0x62E9AC6: QTextFormatCollection::indexForFormat(QTextFormat const&) (../include/QtCore/../../src/corelib/tools/qhash.h:865) ==6491== by 0x62E9E51: QTextFormatCollection::createObjectIndex(QTextFormat const&) (/var/tmp/qt-src/src/gui/text/qtextformat.cpp:3142) ==6491== by 0x62FF56E: QTextDocumentPrivate::createObject(QTextFormat const&, int) (/var/tmp/qt-src/src/gui/text/qtextdocument_p.cpp:1588) ==6491== by 0x62FFD57: QTextDocumentPrivate::rootFrame() const (/var/tmp/qt-src/src/gui/text/qtextdocument_p.cpp:1407) ==6491== by 0x63203B0: QTextDocumentLayout::doLayout(int, int, int) (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:2908) ==6491== by 0x632051C: QTextDocumentLayoutPrivate::ensureLayoutedByPosition(int) const (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:3076) ==6491== by 0x6320978: QTextDocumentLayoutPrivate::layoutStep() const (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:3082) ==6491== by 0x632123C: QTextDocumentLayout::documentChanged(int, int, int) (/var/tmp/qt-src/src/gui/text/qtextdocumentlayout.cpp:2874) ==6491== by 0x62EF7D3: QTextDocument::documentLayout() const (/var/tmp/qt-src/src/gui/text/qtextdocument.cpp:1070) ==6491== by 0x62C0D36: QTextControlPrivate::_q_documentLayoutChanged() (/var/tmp/qt-src/src/gui/text/qtextcontrol.cpp:624) ==6491== by 0x62C104E: QTextControlPrivate::setContent(Qt::TextFormat, QString const&, Q ********************************************************************* -- Anisha Kaul |
|
From: Tom H. <to...@co...> - 2012-12-05 09:25:06
|
On 05/12/12 09:08, Anisha Kaul wrote: > The problem is that the functions pointed out by Valgrind are NO where > in my code. I haven't used functions like - `createObject`, > `setContent` etc. anywhere. They look like internal Qt functions. You need to use --num-callers to ask for deeper stack traces so that you can see where in your code those calls are originating from. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |
|
From: Anisha K. <bor...@gm...> - 2012-12-05 09:26:36
|
On 5 December 2012 14:54, Tom Hughes <to...@co...> wrote: > You need to use --num-callers to ask for deeper stack traces so that you can > see where in your code those calls are originating from. > > Tom Thanks for your response. I'll try that and get back. -- Anisha Kaul |
|
From: <pa...@fr...> - 2012-12-05 15:53:53
|
----- Original Message ----- > Greetz, > > Using C++, Qt 4.7, openSUSE 11.4, Valgrind, GCC > > Actually this application runs very fine on Linux, but "crashes" on > Windows if I "move the mouse wheel". > I have NOT written any event for wheel handling in the code. > > How to know whether problem is in my code or not? Well usually in heavily used code like Qt, the error is in the client code. Not always. > `valgrind --leak-check=full -v offline` > > results in: > First off, the problem could be platform specific. There are quite big differences between X11 and Win32. However, my guess is that you have a problem in your 'model' (Qt 4 uses a form of MVC). You're getting uninitialized reads when Qt is looking for something in a hash table, which looks like a redraw resulting from setting the conent of a text control. A+ Paul |
|
From: Wiser, T. <TW...@lo...> - 2012-12-05 16:11:18
|
>Valgrind shows tons of errors pointing to Qt's source files, but not to my source files! >Please explain what to make out of this. I don't use QT, but I've noticed similar behavior when I have a statically linked application (tons of errors reported in libraries, not my code). If I changed to dynamic linking all the library errors went away. Just a shot in the dark. Tyson |
|
From: Julian S. <js...@ac...> - 2012-12-05 17:14:43
|
On Wednesday, December 05, 2012, Wiser, Tyson wrote: > >Valgrind shows tons of errors pointing to Qt's source files, but not to my > >source files! Please explain what to make out of this. > > I don't use QT, but I've noticed similar behavior when I have a statically > linked application (tons of errors reported in libraries, not my code). If > I changed to dynamic linking all the library errors went away. Just a > shot in the dark. Static linking is a known cause of problems for Memcheck. It is not supported, at least not in simple, out-of-the-box configurations. Basically, avoid it. J |