GNOME Bugzilla – Bug 778918
Cancelling a build causes glib to emit a critical warning
Last modified: 2017-02-20 17:47:32 UTC
If you have tracing enabled and press the cancel button after starting a build, the process is killed by ide_subprocess_launcher_kill_process_group() but before the process finishes exiting and causes g_subprocess_exited() to happen, the wait callback, ide_simple_subprocess_wait_cb is called and emits this: 12:28:03.0027 GLib-GIO[12548]: CRITICAL: g_subprocess_get_if_exited: assertion 'subprocess->pid == 0' failed 12:28:03.0027 GLib-GIO[12548]: CRITICAL: g_subprocess_get_term_sig: assertion 'subprocess->pid == 0' failed So a workaround would be to just check if the cancellable is cancelled and not call those glib functions in that case. Or maybe glib's behavior should be changed; I'm not sure.
Created attachment 346278 [details] [review] subprocess: only call g_subprocess_get_* APIs if not cancelled Since we made our IdeSubprocess wrappers force exit processes when their cancellable is triggered, we don't want to call these APIs unless we know the process has exited. We can check for this by seeing if the error is a cancelled error. It only affects tracing builds anyway.
Attachment 346278 [details] pushed as 6c482b5 - subprocess: only call g_subprocess_get_* APIs if not cancelled