‘guix pack -RR’: audit library is dynamically linked

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal

Debbugs page

L
L
Ludovic Courtès wrote on 27 Jul 2020 07:04
(address . bug-guix@gnu.org)
87tuxtuk9m.fsf@inria.fr
The audit library created by ‘guix pack -RR’, called ‘pack-audit.so’, is
dynamically-linked. Thus, it cannot be loaded (unless there are working
libgcc.so and libc.so in the search path?), leading to failures like
this:

Toggle snippet (5 lines)
$ GUIX_EXECUTION_ENGINE=performance ./bin/sinfo --version
ERROR: ld.so: object '/…/lcourtes/tmp/t/gnu/store/0n6nnvzgxyisg0bszb5zqxp2gzdwh7h3-pack-audit.so' cannot be loaded as audit interface: cannot open shared object file; ignored.
/…/lcourtes/tmp/t/gnu/store/3dhy2f3djmm1h5ix5aa84lrskxzrl6d0-slurm-19.05.3-2/bin//sinfo: error while loading shared libraries: libslurmfull.so: cannot open shared object file: No such file or directory

The root cause is that ‘pack-audit.so’ NEEDs libgcc_s.so, which on this
machine could not be loaded, and thus resolving the other dependencies
of the wrapped executable, like ‘libslurmfull.so’ here, fails.

Ludo’.
L
L
Ludovic Courtès wrote on 28 Jul 2020 05:49
Re: bug#42558: ‘guix pack -RR ’: audit library is dynamically linked
(address . 42558@debbugs.gnu.org)
87r1svu7md.fsf@gnu.org
Ludovic Courtès <ludovic.courtes@inria.fr> skribis:

Toggle quote (13 lines)
> The audit library created by ‘guix pack -RR’, called ‘pack-audit.so’, is
> dynamically-linked. Thus, it cannot be loaded (unless there are working
> libgcc.so and libc.so in the search path?), leading to failures like
> this:
>
> $ GUIX_EXECUTION_ENGINE=performance ./bin/sinfo --version
> ERROR: ld.so: object '/…/lcourtes/tmp/t/gnu/store/0n6nnvzgxyisg0bszb5zqxp2gzdwh7h3-pack-audit.so' cannot be loaded as audit interface: cannot open shared object file; ignored.
> /…/lcourtes/tmp/t/gnu/store/3dhy2f3djmm1h5ix5aa84lrskxzrl6d0-slurm-19.05.3-2/bin//sinfo: error while loading shared libraries: libslurmfull.so: cannot open shared object file: No such file or directory
>
> The root cause is that ‘pack-audit.so’ NEEDs libgcc_s.so, which on this
> machine could not be loaded, and thus resolving the other dependencies
> of the wrapped executable, like ‘libslurmfull.so’ here, fails.

Fixed by commit c6c0d5a22c2ee3d7164dab0129b2e4852a4ae76c.

How could this happen? I think there are two key factors:

1. Most likely I tested v1 of the patch series on “real” non-Guix
machines, but when iterating on v2 (which removed ‘--library-path’
from the ld.so invocation¹) I probably relied on
‘tests/guix-pack-relocatable.sh’, which emulates a machine where
/gnu is empty by mounting a tmpfs on it.

2. There was another bug in ‘exec_with_loader’ whereby it would
symlink its store to that writable /gnu. Thus, the tests would run
as if the store was already available under /gnu/store, thereby
hiding the actual issue. This second bug is fixed by
c088aa2988ef82289c87ebfd6d07d8f1464dd8f0.

AFAICS we’re all fine now.

You’re very welcome to give it a spin on a Guix-less machine! Just do:

guix pack -RR your favorite packages -S /bin=bin

Send the resulting tarball to that machine, and then:

mkdir test
cd test
tar xf /path/to/pack.tar.gz
GUIX_EXECUTION_ENGINE=fakechroot ./bin/your-favorite-command

Ludo’.

L
L
Ludovic Courtès wrote on 28 Jul 2020 05:49
control message for bug #42558
(address . control@debbugs.gnu.org)
87pn8fu7m4.fsf@gnu.org
tags 42558 fixed
close 42558
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 42558@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 42558
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch