I'm having an intermittent issue where the following main.cpp will hang on the call to QApplication (int argc, char *argv[]) at a poll() call.
I'm using Qt 5.1.1, g++ 4.8.5 and Eclipse 4.11.0 on RHEL 7.8.

This is the simple main program that QtCreator created for me so I'm assuming that it is doing it as expected.
Qt Code:
  1. #include <QApplication>
  3. #include "MyMainWindow.h"
  5. int main (int argc, char *arg[])
  6. {
  7. QApplication a (argc, argv);
  9. MyMainWindow w;
  11. a.exec()
  12. }
To copy to clipboard, switch view to plain text mode 

I'm currently using Eclipse as my IDE and am using the .pro file from QtCreator and qmake to create a Makefile which I then compile with in Eclipse.

My problem is that occasionally my program hangs and when I use the Eclipse debugger (gdb) to see where it's hanging up it's in a call to poll() . This means that it never leaves QApplication to start MyMainWindow.

Like I said this only happens occasionally and sometimes I can just logoff and back on and it works. Rebooting the system always fixes it, but that's kind of exteme.

Has anyone seen this before? It's very frustrating since I'm on a tight schedule and I can't reboot this system every time this happens.