hang

How can I detect a hang in QEventLoop?

孤人 提交于 2019-11-26 16:29:18
问题 I am not sure if the title of my question is formulated correctly, so to explain what I really mean, consider the following example: I create a QApplication and a QWidget with a QPushButton on it. Then I attach a handler to the click signal from the button that looks like this: void MyWidget::on_pushButton_clicked(){ //Never return while(true); } Finally I start the event loop for the application and when I run the program and the window shows up click the button. This will in my case stall

StandardOutput.ReadToEnd() hangs [duplicate]

自作多情 提交于 2019-11-26 06:36:31
问题 This question already has answers here : ProcessStartInfo hanging on “WaitForExit”? Why? (21 answers) Closed 2 years ago . I have a program that frequently uses an external program and reads its outputs. It works pretty well using your usual process redirect output, but one specific argument for some reason hangs when I try to read it, no error message - no exception, it just \'stops\' when it reaches that line. I of course use a centralized function to call and read output from the program,

Python C program subprocess hangs at “for line in iter”

痴心易碎 提交于 2019-11-26 01:22:07
问题 Ok so I\'m trying to run a C program from a python script. Currently I\'m using a test C program: #include <stdio.h> int main() { while (1) { printf(\"2000\\n\"); sleep(1); } return 0; } To simulate the program that I will be using, which takes readings from a sensor constantly. Then I\'m trying to read the output (in this case \"2000\" ) from the C program with subprocess in python: #!usr/bin/python import subprocess process = subprocess.Popen(\"./main\", stdout=subprocess.PIPE) while True: