Created attachment 97061 [details] [PATCH] Fix problem with removing non-existent source *** Issue *** root:~> /usr/lib/polkit-1/polkitd Successfully changed to user polkitd 07:01:19.734: Loading rules from directory /etc/polkit-1/rules.d 07:01:19.742: Loading rules from directory /usr/share/polkit-1/rules.d 07:01:19.756: Finished loading, compiling and executing 2 rules Entering main event loop Connected to the system bus 07:01:19.795: Acquired the name org.freedesktop.PolicyKit1 on the system bus ^CHandling SIGINT Shutting down (polkitd:9529): GLib-CRITICAL **: Source ID 2 was not found when attempting to remove it Exiting with code 0 *** Solution *** The problem is quite old but the message is new because GLib 2.40.0 introduced the following change: "[..] g_source_remove() will now throw a critical in the case that you try to remove a non-existent source. We expect that there is some code in the wild that will fall afoul of this new critical but considering that we now reuse source IDs, this code is already broken and should probably be fixed." In polkitd.c file, on_sigint() callback returns FALSE, what means that the source will be removed, so we shouldn't use g_source_remove (sigint_id) after "out" statement.
We still do need to remove the source if we *weren't* interrupted. Probably make the id a static variable.
(In reply to comment #1) > We still do need to remove the source if we *weren't* interrupted. Probably > make the id a static variable. Right, so maybe better solution is not remove source in on_sigint() handler - on_sigint() returns TRUE if the source shouldn't be removed.
Created attachment 97736 [details] [review] [PATCH v2] Fix problem with removing non-existent source
That should work, yes. I added a topic prefix "polkitd: " and a link to this bug to the commit message and pushed. Thanks for the patch!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.