PDA

View Full Version : How to debug a QT application which hangs after some time of run



venk2ksubbu
14th April 2011, 14:12
Hi,

I have an application which uses QProcess to talk to a gdb. The program runs for some time and the application hangs after it. There is a thread which reads the output periodically from the process and application sends next command only after receiving output for the previous command. How to debug this kind of problem ?

Thanks in advance,
Subbarao

high_flyer
14th April 2011, 14:22
Run the application in a debugger.
Once it "hangs" press pause in the debugger, and continue to step through, and see what the code is doing which it is not supposed to do.

venk2ksubbu
16th April 2011, 10:42
Hi,

Thanks for the suggestion.

I attached the gdb to the process when the application got hanged. At the top of the callstack I can see __pthread_read_nocancel followed by ::read call in socketRead function of QProcess class. Have you ever seen this kind of problem ?

Regards,
Subbarao

high_flyer
17th April 2011, 12:05
This is too general to be able to be answered.
Why don't you debug the way I suggested?
Then you can step through and know where you are in the code.