After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778918 - Cancelling a build causes glib to emit a critical warning
Cancelling a build causes glib to emit a critical warning
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
3.23.x
Other Linux
: Normal minor
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-19 18:32 UTC by Matthew Leeds
Modified: 2017-02-20 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
subprocess: only call g_subprocess_get_* APIs if not cancelled (2.02 KB, patch)
2017-02-20 17:47 UTC, Christian Hergert
committed Details | Review

Description Matthew Leeds 2017-02-19 18:32:39 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.
Comment 1 Christian Hergert 2017-02-20 17:47:09 UTC
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.
Comment 2 Christian Hergert 2017-02-20 17:47:29 UTC
Attachment 346278 [details] pushed as 6c482b5 - subprocess: only call g_subprocess_get_* APIs if not cancelled