GNU bug report logs

#47115 Redundant library grafts leads to breakage

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #76 received at 47115@debbugs.gnu.org (full text, mbox, reply):

Received: (at 47115) by debbugs.gnu.org; 16 Mar 2021 08:28:41 +0000
From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 16 04:28:40 2021
Received: from localhost ([127.0.0.1]:38107 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1lM54B-0000jO-Vf
	for submit@debbugs.gnu.org; Tue, 16 Mar 2021 04:28:40 -0400
Received: from world.peace.net ([64.112.178.59]:49542)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@netris.org>)
 id 1lM547-0000i3-BV; Tue, 16 Mar 2021 04:28:37 -0400
Received: from mhw by world.peace.net with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <mhw@netris.org>)
 id 1lM540-0002hw-UH; Tue, 16 Mar 2021 04:28:29 -0400
From: Mark H Weaver <mhw@netris.org>
To: Jack Hill <jackhill@jackhill.us>
Subject: Re: bug#47115: Grafts without deduplication can lead to breakage in
 Guile (was: Failure building grub-img.png when reconfiguring)
In-Reply-To: <alpine.DEB.2.21.2103152233590.8138@marsh.hcoop.net>
References: <alpine.DEB.2.21.2103121747190.8138@marsh.hcoop.net>
 <YEvznooRt4wUjDtA@jasmine.lan> <87a6r7294k.fsf@netris.org>
 <alpine.DEB.2.21.2103121931030.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103122301220.8138@marsh.hcoop.net>
 <877dmb1owa.fsf@netris.org>
 <alpine.DEB.2.21.2103131506140.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103132302490.8138@marsh.hcoop.net>
 <874khds84o.fsf@netris.org>
 <alpine.DEB.2.21.2103141914430.8138@marsh.hcoop.net>
 <87y2epqnq8.fsf@netris.org>
 <alpine.DEB.2.21.2103142334250.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103142350500.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103151642290.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103152139000.8138@marsh.hcoop.net>
 <alpine.DEB.2.21.2103152233590.8138@marsh.hcoop.net>
Date: Tue, 16 Mar 2021 04:26:57 -0400
Message-ID: <875z1rjyfn.fsf@netris.org>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47115
Cc: 47115@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
retitle 47115 Grafts without deduplication can lead to breakage in Guile
thanks

Hi Jack,

Jack Hill <jackhill@jackhill.us> writes:

> I believe that I have identified the problematic difference in my 
> operating system config between my working and non-working hosts.

Thanks very much for your investigation.

> I am forced to conclude that running the guix-daemon with deduplication 
> disabled causes this build failure. Spooky!

Very interesting!

The only difference deduplication makes is that it (usually) causes
identical files in the store to be hard links to the same inode.

I have a new hypothesis:

Suppose that a reference to the original (ungrafted) version of some
library (e.g. libcairo or librsvg) has survived unchanged by the
grafting process.  This could lead to two copies of the same library
being loaded.  For example, I guess that libcairo is loaded by both
librsvg and by guile-cairo.  One of them might load the original
libcairo, and the other might load the replacement libcairo.

If the library is loaded twice, that could lead to each instance of the
library having its own dynamically-allocated type tags, which could lead
to this kind of error.

Here's the code where the error occurred:

  https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/svg.scm?id=bc16eacc99e801ac30cbe2aa649a2be3ca5c102a#n40

Guile uses 'cairo-create' (via guile-cairo) to create a cairo-context,
and then passes it to 'rsvg-handle-render-cairo', a 'librsvg' function,
which complains that the context argument has the wrong type.

If 'guile-cairo' was somehow using a different instance of 'libcairo'
than the one that 'librsvg' is linked to, that could explain what we're
seeing, because the two instances of 'libcairo' would have different
ideas of what the cairo-context tag should be.

However, *if* you have deduplication enabled, and *if* the library in
question doesn't contain any references that require rewrites due to
grafts, then these two copies of the library would most likely[*] be
hard links to the same inode.  Perhaps in that case, the run-time loader
recognizes that these are in fact the same library, and suppresses the
redundant load.

I don't know if this is what's happening, but it seems plausible.
Thoughts?

     Regards,
       Mark




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 15:42:19 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.