Important: Please read the Qt Code of Conduct -

Application / QApplication problems with Valgrind

  • I get the following problem with Application / QApplication when running Valgrind in Qt Creator:

    Conditional jump or move depends on uninitialised value(s)
      in Application in /home/daniel/Documents/Qt/ElectimaxWin/main.h:7
      1: /usr/lib/x86_64-linux-gnu/
      2: /usr/lib/x86_64-linux-gnu/
      3: g_signal_emit_valist in /usr/lib/x86_64-linux-gnu/
      4: g_signal_emit_by_name in /usr/lib/x86_64-linux-gnu/
      5: g_object_set_valist in /usr/lib/x86_64-linux-gnu/
      6: g_object_set in /usr/lib/x86_64-linux-gnu/
      7: /usr/lib/x86_64-linux-gnu/
      8: QStyleFactory::create(QString const&) in /usr/lib/x86_64-linux-gnu/
      9: QApplication::style() in /usr/lib/x86_64-linux-gnu/
      10: QApplicationPrivate::initialize() in /usr/lib/x86_64-linux-gnu/
      11: QApplicationPrivate::construct() in /usr/lib/x86_64-linux-gnu/
      12: Application in /home/daniel/Documents/Qt/ElectimaxWin/main.h:7
      13: main in /home/daniel/Documents/Qt/ElectimaxWin/main.cpp:47
    Uninitialised value was created by a stack allocation  1: g_cclosure_marshal_VOID__VOIDv in /usr/lib/x86_64-linux-gnu/

    Here is my main program:

    #include <QApplication>
    #include <QMessageBox>
    #include <typeinfo>
    #include "main.h"
    #include "mainwindow.h"
    bool Application::notify(QObject* receiver, QEvent* event)
            return QApplication::notify(receiver, event);
        catch (std::exception &e)
            qFatal("Error %s sending event %s to object %s (%s)",
                e.what(), typeid(*event).name(), qPrintable(receiver->objectName()), typeid(*receiver).name());
        catch (...)
            qFatal("Error <unknown> sending event %s to object %s (%s)",
                typeid(*event).name(), qPrintable(receiver->objectName()), typeid(*receiver).name());
        return false;
    int main(int argc, char *argv[])
        Application a(argc, argv);
        MainWindow w;;
        return a.exec();

    And main.h:

    #include <QApplication>
    class Application final : public QApplication
        using QApplication::QApplication;
        virtual bool notify(QObject *receiver, QEvent *e) override;

  • Qt Champions 2019

    As you can see it's somewhere deep inside libgobject/libgtk - don't think Qt can do anything against it here. I would simply ignore it.

  • Thanks for the tip!

  • This post is deleted!

Log in to reply