PDA

View Full Version : Global QProcess Object Hangs Program



sandsaturn22
3rd January 2014, 17:10
Greetings!

I have noticed some strange behavior when creating a global QProcess object and starting a program with it. After the program returns from main() the program does not close but instead hangs the system. Additionally the following error is displayed "*** glibc detected *** ./test: corrupted double-linked list: 0x09bc2678 ***". This problem is reproducible using Qt 4.7.1 on Ubuntu 12.04 x86 with the following short program:


#include <stdio.h>
#include <unistd.h>
#include <QProcess>

QProcess process;

int main()
{
printf("Starting process\n");
process.start("ls");
printf("Waiting for process to start\n");
if (!process.waitForStarted())
{
printf("ERROR = %d\n", process.error());
return -1;
}

printf("Waiting for process to finish\n");
if (!process.waitForFinished())
{
printf("ERROR - process didn't complete\n");
}
process.close();
printf("Process state before exiting = %d\n", process.state());

return 0;
}

When I upgrade Qt to 5.2.0 the problem is no longer reproducible. Searching the Qt Bug Tracker I don't see any documented issues on this problem. Does anyone know if this is a known bug that has been corrected?

Thanks!