unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Jack Hill <jackhill@jackhill.us>
Cc: 47115@debbugs.gnu.org
Subject: bug#47115: Grafts without deduplication can lead to breakage in Guile (was: Failure building grub-img.png when reconfiguring)
Date: Tue, 16 Mar 2021 04:26:57 -0400	[thread overview]
Message-ID: <875z1rjyfn.fsf@netris.org> (raw)
In-Reply-To: <alpine.DEB.2.21.2103152233590.8138@marsh.hcoop.net>

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




  reply	other threads:[~2021-03-16  8:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 22:58 bug#47115: Failure building grub-img.png when reconfiguring Jack Hill
2021-03-12 23:05 ` Leo Famulari
2021-03-13  0:24   ` Mark H Weaver
2021-03-13  0:33     ` Jack Hill
2021-03-13  4:05       ` Jack Hill
2021-03-13  7:41         ` Mark H Weaver
2021-03-13 20:08           ` Jack Hill
2021-03-14  4:27             ` Jack Hill
2021-03-14 20:49               ` Jack Hill
2021-03-14 21:14                 ` Jack Hill
2021-03-14 22:00                   ` Jack Hill
2021-03-14 22:05               ` Mark H Weaver
2021-03-14 23:18                 ` Jack Hill
2021-03-15  0:11                   ` Mark H Weaver
2021-03-15  3:38                     ` Jack Hill
2021-03-15  3:52                       ` Jack Hill
2021-03-15 20:48                         ` Jack Hill
2021-03-16  1:41                           ` Jack Hill
2021-03-16  2:40                             ` Jack Hill
2021-03-16  8:26                               ` Mark H Weaver [this message]
2021-03-16  9:18                                 ` bug#47115: Redundant library grafts leads to breakage (was: Failure building grub-img.png when reconfiguring) Mark H Weaver
2021-03-20 11:01                                   ` bug#47115: Redundant library grafts leads to breakage Ludovic Courtès
2021-03-14 22:18     ` bug#47115: Failure building grub-img.png when reconfiguring Leo Famulari
2021-03-13  0:25   ` Jack Hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875z1rjyfn.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=47115@debbugs.gnu.org \
    --cc=jackhill@jackhill.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).