futex Error while building on linux for QT Application
-
wrote on 10 Jul 2020, 11:07 last edited by
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.
-
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.
@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. -
wrote on 10 Jul 2020, 13:51 last edited by
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(); }
-
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(); }
@jineshmehta Please use debugger to see where exactly it is crashing and to get stack trace.
-
@jineshmehta Please use debugger to see where exactly it is crashing and to get stack trace.
wrote on 10 Jul 2020, 14:08 last edited by@jsulm I got the stack error but its coming from another thread. Check the snap:
I think it is coming from UI call.
-
@jsulm I got the stack error but its coming from another thread. Check the snap:
I think it is coming from UI call.
@jineshmehta Please use debug build not release
-
@jineshmehta Please use debug build not release
wrote on 10 Jul 2020, 14:40 last edited by@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/7