Bug#1143867: python3-gi: Triggers crash in cinnamon-screensaver`

Fabio Fantoni <[email protected]>
Newsgroups gmane.linux.debian.devel.bugs.rc
Message-ID <ee49eef7-182b-48e0-ba4c-bc8e4fb6ce37__14375.5193612137$1786138518$gmane$org@tiscali.it>
Root cause found, and it is not the same as the Anaconda issue in
https://gitlab.gnome.org/GNOME/pygobject/-/work_items/764 -
cinnamon-screensaver exports its D-Bus interface through the C skeleton
generated by gdbus-codegen, so it never goes through the Python
register_object() override.

What breaks it is that GLib.Pid is no longer an int. Up to 3.56.3 it was
gi._gi.Pid, a C type deriving from int; since 3.57.0 (upstream commit
b6e14902, "Reimplement GLib.spawn_async in Python") it is:

     class Pid:
         def __init__(self, pid): self._pid = pid
         def __int__(self): return self._pid
         def close(self): GLib.spawn_close_pid(self._pid)

No __index__, no rich comparisons. So for any application that keeps the
result of GLib.spawn_async() around, `pid > 0` now raises TypeError and
os.kill(pid, sig) no longer works. In cinnamon-screensaver this aborts the
unlock path and leaves the screen locked (details in #1143872).

I have patches for cinnamon-screensaver ready and also posted upstream,
so this should not hold pygobject back for long. But I would suggest raising
it with pygobject upstream as well: it is a silent API break with no NEWS
entry and no porting note, the class is unchanged in git main, and any other
Python application using GLib.spawn_async() is exposed to it. Adding
__index__ and the integer comparisons back (or simply deriving from int
again) would keep the old code working.
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEELEHRfLe4S9D5+1GzaAZorpB/EB0FAmp2TXAFAwAAAAAACgkQaAZorpB/EB13
pg/+PKYJpMYGj7hcNqxNbZjNY80ZQV/010Ywn1yHKXv1SPc9p40G/7x9/d4LVfDhAw6lNAPrKAIg
6XOvAuB+MYx/y56z95H6ZfUuMhOcbYQmHHJIa7mx6/QPC3x9KZmerSiR+H2wwCAIl6rZm4gTfAE5
GaR7RYCAya8q1lq2Tpj8N3UsByp/NwQTragxDlQ2v2RQCfn1C3vPiFY/1u11Yy2DMFvov5JfVXdq
899cLJQUTbjniGgBSA7XK5CEHAkKlUpZFhpvdawkOu/eKFOiGtJ6qFL2ifbJLMBgdta8H1KpR7qs
CA/CI09TzSefE7FxhQnxuVfhqWaa2umbNVoReRUKSAhyy9goT7MfXf8KeQ8l2FH1oflu3Mssg8rj
C6ARxFE8URJrnB9SIxlogUt1vx+eMfqbTWuy1JSEcgO2xJT8uu/YvxX2PYFi7EZS1YZAR/9jju8p
UFCquSuzWf5wSH+rFX5oSbWRWtR4KxJQ4g6xEVa1a8OAVWnesMHSI2/pel34n+wEGhFyE3Xd7rjR
DZA2ag5paY8mO6vtQ2iEdyrnT0zcc9tyTL8Z99FyHb1PJRvxbNIlpzBaEYbaba76La+/DNVbAKgJ
rnMxHO3hef+rCVSLdxbETyH2uQbxithOj/ZFsyaFyuLH6b40LesVECiGkH+HNHa038pdf8f3y/DB
+Zc=
=cxxu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.