Hello, I was trying to discover the origin of a strange crash in my application and I came up with a strange beaviour of gdb whilst using QProcess and QFileDialog. This is the code to test:

Qt Code:
  1. #include <QProcess>
  2. #include <QString>
  3. #include <QFileDialog>
  4. #include <QApplication>
  5.  
  6. void fai()
  7. {
  8. QProcess myProcess2;
  9. myProcess2.start("ps -aux");
  10. myProcess2.waitForFinished(-1);
  11.  
  12. //Choose a file or press "Cancel", it's the same
  13. QFileDialog::getOpenFileName(0,"Select File Name","","*");
  14.  
  15. QProcess myProcess;
  16. myProcess.start("ps -aux");
  17. myProcess.waitForFinished(-1);
  18. }
  19.  
  20. int main(int argc, char **argv)
  21. {
  22. QApplication app(argc,argv);
  23.  
  24. fai();
  25. fai();
  26.  
  27. return 0;
  28. }
To copy to clipboard, switch view to plain text mode 

The basic behaviour is to run a process, show a filedialog, close the dialog (no matter which choice do you make), and start another process.
Usually the problem arisies at the beginning of the second iteration but sometimes happes even during the first call to "fai()".
The program runs fine if I run it w/o a gdb attached to it. But if I try to debug it, gdb fails giving an error about "Couldn't get register" and the program hangs w/o the possibility to resume it. If I put a breakpoint during the execution of the program, the problems doens't show either. Using visual studio this problem doens't show.

Any hints?

I apologize for being of topic if this is not a Qt releated problem.