Subject: bug#75157: Grafting inconsistency with multiple outputs is causing problems

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sun, 29 Dec 2024 01:24:41 +0100

Hello Dariqq, your debugging is interesting.

My G-Golf GTK program has a critical error at Gdk-Pixbuf, not GLib at
first sight, but see below.

$ guile /gnu/store/hbf4wqssp0aa0m2cxrwaq0mkxfd5y59p-launcher.scm

(guile:1273): Gtk-WARNING **: 01:21:40.538: Unable to acquire session bus: Failed to execute child process “dbus-launch” (No such file or directory)

(guile:1273): GLib-GObject-CRITICAL **: 01:21:40.586: cannot register existing type 'GdkPixbuf'

(guile:1273): GLib-GObject-CRITICAL **: 01:21:40.586: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(guile:1273): GLib-GObject-CRITICAL **: 01:21:40.586: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(guile:1273): GLib-CRITICAL **: 01:21:40.586: g_once_init_leave: assertion 'result != 0' failed

It cannot register existing type 'GdkPixbuf'.
Bisecting reveals the first bad commit is this:

commit 78c4d00ab02ab41a22058cdbec0329752e47580f
gpg: Signature made Mi 18 Dez 2024 08:27:09 CET
gpg:                using RSA key 27D586A4F8900854329FF09F1260E46482E63562
gpg: Can't check signature: No public key
Author: Maxim Cournoyer <[email-masked]>
Date:   Sat Dec 14 22:52:22 2024 +0900

    gnu: glibc: Graft with fix for CVE-2024-2961.
    
    * gnu/packages/base.scm (%glibc-patches): New variable.
    (glibc) [source]: Use it.
    [properties]: Mark CVE-2024-2961 as hidden (resolved).
    [replacement]: Add field to graft with...
    (glibc/fixed): ... this new package.
    
    Fixes: <https://issues.guix.gnu.org/70581>
    Change-Id: I6dd70b0e157283925824348f180c466c2f6387c9

I look at `cat /proc/635/maps`

/gnu/store/1av61zsp5sxs0as48nl52fg78b466r8p-gdk-pixbuf-2.42.10/lib/libgdk_pixbuf-2.0.so.0.4200.10
/gnu/store/1av61zsp5sxs0as48nl52fg78b466r8p-gdk-pixbuf-2.42.10/lib/girepository-1.0/GdkPixbuf-2.0.typelib

and

/gnu/store/10i71f2m5r6rijl8gvn1mpmvzxaxs76l-gdk-pixbuf-2.42.10/lib/libgdk_pixbuf-2.0.so.0.4200.10

this one without a matching typelib, so only the latter was not loaded
through a typelib.

$ guix gc --references /gnu/store/1av61zsp5sxs0as48nl52fg78b466r8p-gdk-pixbuf-2.42.10
/gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0
...
$ guix gc --derivers /gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0
/gnu/store/ikv0s6dr3yzs398i67vh3p0w8jglxm4w-glib-2.78.0.drv
$ guix build /gnu/store/ikv0s6dr3yzs398i67vh3p0w8jglxm4w-glib-2.78.0.drv
/gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0
$ guix gc --references /gnu/store/10i71f2m5r6rijl8gvn1mpmvzxaxs76l-gdk-pixbuf-2.42.10
/gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0
$ guix gc --derivers /gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0
/gnu/store/ikv0s6dr3yzs398i67vh3p0w8jglxm4w-glib-2.78.0.drv
$ guix build /gnu/store/ikv0s6dr3yzs398i67vh3p0w8jglxm4w-glib-2.78.0.drv
/gnu/store/0466q5rlccclzg70f3yprpf9kdvlyfzf-glib-2.78.0

Both my GLibs have one output only.  I still believe above guix commit
is the first bad commit for you, as well, and

guix time-machine -q --commit=78c4d00ab02ab41a22058cdbec0329752e47580f

will show the error and parent commit

guix time-machine -q --commit=08e0144d2338c8fb51e52e74274554583d0faa69

will be fine.  Is it?

I believe what we describe here is yet another symptom of old bug
<https://issues.guix.gnu.org/48907>, but if we have a first bad commit,
and if it is the first bad commit for you, too,
it might help solve it.  Or perhaps this bug can be solved separately if
really the loading through typelib vs. not through typelib is the cause.

Regards,
Florian