Qt 5.10 with Creator 4.5 Valgrind error?



  • I've upgraded to Qt 5.10 with Qt creator 4.5.
    Created an dummy project

    #include <QApplication>
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        return 0;
    }
    

    When trying to profile/run memcheck, valgrind fails with the following message -

    vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF2 0xB9 0x1 0x0 0x0 0x0
    vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
    vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
    vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
    ==2234== valgrind: Unrecognised instruction at address 0x54feef0.
    ==2234==    at 0x54FEEF0: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x54FFA58: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5500458: QRandomGenerator::_fillRange(void*, void*) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x555C59B: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x555CF66: QHashData::detach_helper(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5577242: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5577644: QRegExp::QRegExp(QString const&, Qt::CaseSensitivity, QRegExp::PatternSyntax) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x56019DB: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x560247B: QDirIterator::QDirIterator(QString const&, QStringList const&, QFlags<QDir::Filter>, QFlags<QDirIterator::IteratorFlag>) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x55FBB98: QDir::entryList(QStringList const&, QFlags<QDir::Filter>, QFlags<QDir::SortFlag>) const (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x55FC1DA: QDir::entryList(QFlags<QDir::Filter>, QFlags<QDir::SortFlag>) const (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x56CE761: QFactoryLoader::update() (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234== Your program just tried to execute an instruction that Valgrind
    ==2234== did not recognise.  There are two possible reasons for this.
    ==2234== 1. Your program has a bug and erroneously jumped to a non-code
    ==2234==    location.  If you are running Memcheck and you just saw a
    ==2234==    warning about a bad jump, it's probably your program's fault.
    ==2234== 2. The instruction is legitimate but Valgrind doesn't handle it,
    ==2234==    i.e. it's Valgrind's fault.  If you think this is the case or
    ==2234==    you are not sure, please let us know and we'll try to fix it.
    ==2234== Either way, Valgrind will now raise a SIGILL signal which will
    ==2234== probably kill your program.
    ==2234== 
    ==2234== Process terminating with default action of signal 4 (SIGILL)
    ==2234==  Illegal opcode at address 0x54FEEF0
    ==2234==    at 0x54FEEF0: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x54FFA58: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5500458: QRandomGenerator::_fillRange(void*, void*) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x555C59B: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x555CF66: QHashData::detach_helper(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5577242: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x5577644: QRegExp::QRegExp(QString const&, Qt::CaseSensitivity, QRegExp::PatternSyntax) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x56019DB: ??? (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x560247B: QDirIterator::QDirIterator(QString const&, QStringList const&, QFlags<QDir::Filter>, QFlags<QDirIterator::IteratorFlag>) (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x55FBB98: QDir::entryList(QStringList const&, QFlags<QDir::Filter>, QFlags<QDir::SortFlag>) const (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x55FC1DA: QDir::entryList(QFlags<QDir::Filter>, QFlags<QDir::SortFlag>) const (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==    by 0x56CE761: QFactoryLoader::update() (in /home/innereye/Qt5.10.0/5.10.0/gcc_64/lib/libQt5Core.so.5.10.0)
    ==2234==
    

    When deleting the line QApplication a(argc, argv); it works fine.
    With 5.7 and creator 4.2 it worked. I'm using Gcc 7.2 and valgrind-3.11.0, any suggestions?



  • @Jonathan-Levanon said in Qt 5.10 with Creator 4.5 Valgrind error?:

    SIGILL

    Interesting, can you show the completed kit menu?



  • 0_1516810972746_Screenshot from 2018-01-24 18-22-06.png
    This?



  • Anybody?



  • @Jonathan-Levanon

    Your kits seem ok, Would you like to share the compiler output after you attempt of a run?

    Thanks



  • You mean the assembly output? How can I get it with qtcreator?



  • @Jonathan-Levanon
    I found out that can be either Qt problem or dependencies libraries problem, even more, sometimes only Valgrind detects this issue, you can check these posts and see that you aren't alone:

    https://stackoverflow.com/questions/21037530/why-does-qapplication-give-memory-leaks
    https://stackoverflow.com/questions/12617212/valgrind-shows-many-warnings-errors-of-simple-qml-application
    https://stackoverflow.com/questions/7049036/valgrind-on-basic-qt-application-reports-masive-leaks

    Unfortunately, they don't express a direct solution, so reinstalling all might solve this issue:

    BTW, How did you install Qt? From online installer? Did you erase the older Qt version before installing? Can you update libraries- if you're using Linux a sudo apt-get install updates, sudo-apt install upgrade can help.

    As a sanity check, remove Qt, I don't know from MAC OS, but in Linux, there is a folder called qtcreator-4.5.0 and inside it, there is an executable called QtCreatorUnistaller, run it and delete the whole package, then try reinstalling Qt Online.

    After that create a similar project using the Creation Wizard and try both in Debug(F5) and Run (Ctrl+R) modes.

    If the problem persists, I'd like to have 3 screenshots/text.

    • Compile Output (Alt+4) dock text.

    • Go to Project (on the left), there is a Build & Run area, select Run, and go to the Valgrind Settings, screenshot.

    • Go to Tools->Options->Analyzer->Valgrind and screenshot, you can reduce the level of analysis and see what happened. It's something like this:

    0_1517419176882_5abbc7d9-b351-4eb5-8b5a-fa8b23b9c5a9-image.png

    I haven't had issues with valgrind, so I'm not sure about this issue.



  • So this is old but -
    I've reinstalled my Ubuntu for unrelated issues. After that, installed only Qt 5.10 with the .run installer.

    Created an empty Qt widgets application, and got the same crash when profiling.

    Compiler output -

    home/Qt5.10.0/5.10.0/gcc_64/bin/uic ../mvce/mainwindow.ui -o ui_mainwindow.h
    g++ -c -pipe -O2 -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../mvce -I. -I../Qt5.10.0/5.10.0/gcc_64/include -I../Qt5.10.0/5.10.0/gcc_64/include/QtWidgets -I../Qt5.10.0/5.10.0/gcc_64/include/QtGui -I../Qt5.10.0/5.10.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../Qt5.10.0/5.10.0/gcc_64/mkspecs/linux-g++ -o main.o ../mvce/main.cpp
    g++ -c -pipe -O2 -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../mvce -I. -I../Qt5.10.0/5.10.0/gcc_64/include -I../Qt5.10.0/5.10.0/gcc_64/include/QtWidgets -I../Qt5.10.0/5.10.0/gcc_64/include/QtGui -I../Qt5.10.0/5.10.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../Qt5.10.0/5.10.0/gcc_64/mkspecs/linux-g++ -o mainwindow.o ../mvce/mainwindow.cpp
    g++ -pipe -O2 -g -Wall -W -dM -E -o moc_predefs.h ../Qt5.10.0/5.10.0/gcc_64/mkspecs/features/data/dummy.cpp
    /home/Qt5.10.0/5.10.0/gcc_64/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/home/Qt5.10.0/5.10.0/gcc_64/mkspecs/linux-g++ -I/home/mvce -I/home/Qt5.10.0/5.10.0/gcc_64/include -I/home/Qt5.10.0/5.10.0/gcc_64/include/QtWidgets -I/home/Qt5.10.0/5.10.0/gcc_64/include/QtGui -I/home/Qt5.10.0/5.10.0/gcc_64/include/QtCore -I. -I/usr/include/c++/7 -I/usr/include/x86_64-linux-gnu/c++/7 -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../mvce/mainwindow.h -o moc_mainwindow.cpp
    g++ -c -pipe -O2 -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../mvce -I. -I../Qt5.10.0/5.10.0/gcc_64/include -I../Qt5.10.0/5.10.0/gcc_64/include/QtWidgets -I../Qt5.10.0/5.10.0/gcc_64/include/QtGui -I../Qt5.10.0/5.10.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../Qt5.10.0/5.10.0/gcc_64/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp
    g++ -Wl,-rpath,/home/Qt5.10.0/5.10.0/gcc_64/lib -o mvce main.o mainwindow.o moc_mainwindow.o   -L/home/Qt5.10.0/5.10.0/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread 
    objcopy --only-keep-debug mvce mvce.debug && objcopy --strip-debug mvce && objcopy --add-gnu-debuglink=mvce.debug mvce && chmod -x mvce.debug
    

    0_1525960602810_Screenshot from 2018-05-10 16-55-21.png

    Using valgrind-3.11.0


  • Lifetime Qt Champion

    Hi,

    What version of GCC were you using when you had it working ?



  • Exactly the same version, 7.2



  • Anybody?


  • Lifetime Qt Champion

    Wonder if it's similar to this KDE bug report.



  • Only 5 months later, I've installed valgrind 3.13 and it's working :), though I had to patch it with
    https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=870419;filename=0001-Fix-parsing-of-xml-socket-argument.patch;msg=5

    to make it work


Log in to reply
 

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