Sometimes duplicate zombie client windows are left behind
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Accomplishments Viewer |
Fix Released
|
Low
|
Rafał Cieślak |
Bug Description
I have noticed that sometimes when killing the GUI from the command line some zombie windows are still lying around. This happened recently and I saw this output:
^CTraceback (most recent call last):
File "/usr/share/
subprocess.
File "/usr/lib/
Traceback (most recent call last):
File "/usr/bin/quickly", line 101, in <module>
exit(main())
File "/usr/bin/quickly", line 86, in main
return(
File "/usr/lib/
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/
pid, sts = _eintr_
File "/usr/lib/
return func(*args)
KeyboardInterrupt
[self.command] + command_args, cwd=project_path)
File "/usr/lib/
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/
pid, sts = _eintr_
File "/usr/lib/
return func(*args)
KeyboardInterrupt
jono@forge2:
File "/home/
def on_destroy(self, widget, data=None):
KeyboardInterrupt
Related branches
affects: | ubuntu-accomplishments-system → ubuntu-accomplishments-viewer |
Changed in ubuntu-accomplishments-viewer: | |
milestone: | 0.1 → none |
milestone: | none → 0.1 |
Changed in ubuntu-accomplishments-viewer: | |
status: | Fix Committed → Fix Released |
This is a tricky one. We are unable to catch the KeyboardInterrupt from main.py, as it gets lost in the Gtk's separate thread. We might use a signal handler for SIGINT, and use it to hide and destroy the window, but it will not work, as hiding/destroying widgets requires a Gtk iteration, which we'll be unable to trigger due to the order of how Python's "pending calls" will be proceeded, and at the time we execute the signal handler, the GUI will have already received a KeyboardInterrupt, which causes it to stop working.
The best way I've found it to add signal( signal. SIGINT, signal.SIG_DFL)
signal.
to main(), it instructs the app to call the default signal handler, when it gets the SIGINT.
This actually closes the window and stops the program completely. However, this will not prevent the Gtk thread from complaining about handled KeyboardInterrupt in the standard output, because that thread will receive the interrupt first. All in all, that's not a minor problem, just an ugly traceback when pressing Ctrl+C.
I've linked in a branch that demonstrates this solution.