Closed whot closed 1 year ago
:+1:
When I understand the linked issue correctly, shouldn't dbus-next destroy *all* sources whenever they return GLib.SOURCE_REMOVE
(e.g. what is called Option a
in the linked issue)? That seems also way easier compared to what is called Option b
in the issue, e.g. destroying it in the callbacks.
Side-note: all versions of Debian are affected by the issue, likely due to there not being a release since this fix.
fwiw, I have virtually no recollection of the specifics of this bug but I think this bug may have been specific to subclassing GLib.Source
. But that's a very vague guess after all this time.
I think this bug may have been specific to subclassing
GLib.Source
Thanks for your comment. Right, should have been more specific in the earlier comment. That is what I was referring to (there are at least 3 GLib.Source
subclasses in message_bus.py
).
Anyway, this project seems dead and apparently dbus-fast didn't cherry-pick the fix either. I guess another python dbus lib bites the dust. Which is a bit sad as the asyncio part here seems to work great and I really like the API. But with it potentially segfaulting depending on the version packaged (e.g. way more likely to segfault than not) I can't use it with GTK.
hmm, yeah, that makes sense though I probably didn't trigger this back then, so... :shrug:
See https://gitlab.gnome.org/GNOME/pygobject/-/issues/525 for an explanation, the summary is: we need to explicitly call source.destroy() if dispatch returns GLib.SOURCE_REMOVE.
Deleting the source by resetting it to None causes invalid memory accesses and eventual crashes.
This can be reproduced with a basic call to
and a
GLib.MainLoop()
after this call. Run invalgrind --tool=memcheck
.Fixes #113