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. futex Error while building on linux for QT Application
Forum Updated to NodeBB v4.3 + New Features

futex Error while building on linux for QT Application

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 796 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.
  • J Offline
    J Offline
    jineshmehta
    wrote on last edited by
    #1

    I am trying to test a close splash screen example. But facing some difficulties. I have attached all my relevant files below:

    Following in my pro file:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    RESOURCES += \
        test.qrc
    

    Here is my main.cpp

        QApplication a(argc, argv);
        MainWindow w;
        QPixmap pixMap(":/images/Splash.bmp");
        QSplashScreen* splash = new QSplashScreen(pixMap,Qt::WindowStaysOnTopHint);
        splash->show();
        QTime waitTime = QTime::currentTime().addSecs(2);
        while (QTime::currentTime() < waitTime)
            QCoreApplication::processEvents();
        splash->hide();
        w.show();
        return a.exec();
    

    Here is my mainwindow.cpp :

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    

    The problem is my application crashes when I try to show splashscreen on line 12 in main.cpp. I get the error :

    The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.

    jsulmJ 1 Reply Last reply
    0
    • J jineshmehta

      I am trying to test a close splash screen example. But facing some difficulties. I have attached all my relevant files below:

      Following in my pro file:

      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++11
      
      # The following define makes your compiler emit warnings if you use
      # any Qt feature that has been marked deprecated (the exact warnings
      # depend on your compiler). Please consult the documentation of the
      # deprecated API in order to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
          main.cpp \
          mainwindow.cpp
      
      HEADERS += \
          mainwindow.h
      
      FORMS += \
          mainwindow.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      RESOURCES += \
          test.qrc
      

      Here is my main.cpp

          QApplication a(argc, argv);
          MainWindow w;
          QPixmap pixMap(":/images/Splash.bmp");
          QSplashScreen* splash = new QSplashScreen(pixMap,Qt::WindowStaysOnTopHint);
          splash->show();
          QTime waitTime = QTime::currentTime().addSecs(2);
          while (QTime::currentTime() < waitTime)
              QCoreApplication::processEvents();
          splash->hide();
          w.show();
          return a.exec();
      

      Here is my mainwindow.cpp :

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      

      The problem is my application crashes when I try to show splashscreen on line 12 in main.cpp. I get the error :

      The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.The futex facility returned an unexpected error code.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @jineshmehta said in futex Error while building on linux for QT Application:

      while (QTime::currentTime() < waitTime)
      QCoreApplication::processEvents();

      This is not how it should be done!
      Remove the loop.
      Use a timer to hide the splash.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • J Offline
        J Offline
        jineshmehta
        wrote on last edited by
        #3

        Even with this code it is crashing after show:

        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
            MainWindow w;
            QPixmap pixMap(":/images/Splash.bmp");
            QSplashScreen* splash = new QSplashScreen(pixMap,Qt::WindowStaysOnTopHint);
            splash->show();
            splash->hide();
            w.show();
            return a.exec();
        }
        
        jsulmJ 1 Reply Last reply
        0
        • J jineshmehta

          Even with this code it is crashing after show:

          int main(int argc, char *argv[])
          {
              QApplication a(argc, argv);
              MainWindow w;
              QPixmap pixMap(":/images/Splash.bmp");
              QSplashScreen* splash = new QSplashScreen(pixMap,Qt::WindowStaysOnTopHint);
              splash->show();
              splash->hide();
              w.show();
              return a.exec();
          }
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @jineshmehta Please use debugger to see where exactly it is crashing and to get stack trace.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          1
          • jsulmJ jsulm

            @jineshmehta Please use debugger to see where exactly it is crashing and to get stack trace.

            J Offline
            J Offline
            jineshmehta
            wrote on last edited by
            #5

            @jsulm I got the stack error but its coming from another thread. Check the snap:

            0be64e65-5a37-4f62-bdf7-f21f25aa966e-image.png

            I think it is coming from UI call.

            jsulmJ 1 Reply Last reply
            0
            • J jineshmehta

              @jsulm I got the stack error but its coming from another thread. Check the snap:

              0be64e65-5a37-4f62-bdf7-f21f25aa966e-image.png

              I think it is coming from UI call.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @jineshmehta Please use debug build not release

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply
              0
              • jsulmJ jsulm

                @jineshmehta Please use debug build not release

                J Offline
                J Offline
                jineshmehta
                wrote on last edited by
                #7

                @jsulm I am running the application in debug mode only. For the reference I have recorded all the steps here:
                https://streamable.com/76rwei

                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