Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Application / QApplication problems with Valgrind
Forum Updated to NodeBB v4.3 + New Features

Application / QApplication problems with Valgrind

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 314 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • GuerrianG Offline
    GuerrianG Offline
    Guerrian
    wrote on last edited by Guerrian
    #1

    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/libgtk-x11-2.0.so.0.2400.30
      2: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.2
      3: g_signal_emit_valist in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.2
      4: g_signal_emit_by_name in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.2
      5: g_object_set_valist in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.2
      6: g_object_set in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.2
      7: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1
      8: QStyleFactory::create(QString const&) in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1
      9: QApplication::style() in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1
      10: QApplicationPrivate::initialize() in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1
      11: QApplicationPrivate::construct() in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1
      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/libgobject-2.0.so.0.4800.2
    

    Here is my main program:

    #include <QApplication>
    #include <QMessageBox>
    #include <typeinfo>
    #include "main.h"
    #include "mainwindow.h"
    
    bool Application::notify(QObject* receiver, QEvent* event)
    {
        try
        {
            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;
        w.show();
        return a.exec();
    }
    

    And main.h:

    #include <QApplication>
    
    class Application final : public QApplication
    {
        Q_OBJECT
    public:
        using QApplication::QApplication;
        virtual bool notify(QObject *receiver, QEvent *e) override;
    };
    
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • GuerrianG Offline
        GuerrianG Offline
        Guerrian
        wrote on last edited by
        #3

        Thanks for the tip!

        1 Reply Last reply
        0
        • GuerrianG Offline
          GuerrianG Offline
          Guerrian
          wrote on last edited by Guerrian
          #4
          This post is deleted!
          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved