Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfs-utils on musl: ldd failure on installed .so #53785

Open
Vaelatern opened this issue Jan 1, 2025 · 16 comments
Open

nfs-utils on musl: ldd failure on installed .so #53785

Vaelatern opened this issue Jan 1, 2025 · 16 comments
Labels
bug Something isn't working

Comments

@Vaelatern
Copy link
Member

Is this a new report?

Yes

System Info

Void 6.6.67_1 x86_64-musl GenuineIntel notuptodate rrrnDDFFFFFFFFFFFF

Package(s) Affected

nfs-utils libnfsidmap

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

On glibc:

$ ldd /usr/lib/libnfsidmap/regex.so
        linux-vdso.so.1 (0x00007ffc5abab000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fdadaa22000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007fdadac3b000)

Actual behaviour

On muslc:

$ ldd /usr/lib/libnfsidmap/regex.so
	ldd (0x7f0f5f58f000)
	libc.so => ldd (0x7f0f5f58f000)
Error relocating /usr/lib/libnfsidmap/regex.so: nfsidmap_config_get: symbol not found
Error relocating /usr/lib/libnfsidmap/regex.so: nfs4_get_default_domain: symbol not found
Error relocating /usr/lib/libnfsidmap/regex.so: idmap_verbosity: symbol not found
Error relocating /usr/lib/libnfsidmap/regex.so: idmap_log_func: symbol not found

Steps to reproduce

This breaks my void-mklive workflows making dracut images of x86_64-musl with the nfs library installed. I remove the nfs library and it works again, so I've narrowed down my build problems to this library.

It seems consistently broken on musl, fixed on glibc. I've checked and it seems the libs are in fact compiled fresh on each build. Upgrading to 2.8.2 didn't help #53784

I've not yet looked at how it's actually being built to see what is broken there.

@Vaelatern Vaelatern added bug Something isn't working needs-testing Testing a PR or reproducing an issue needed labels Jan 1, 2025
@Vaelatern Vaelatern changed the title nfs-utils on void: ldd failure on installed .so nfs-utils on musl: ldd failure on installed .so Jan 1, 2025
@slymattz
Copy link
Contributor

slymattz commented Jan 1, 2025

Hi!

I can reproduce ACTUAL BEHAVIOR on a musl-based Void live system both for nfs-utils 2.7.1 and nfs-utils 2.8.2. Just for the record, there seems to be a similar report for Gentoo describing similar underlinking on musl.

@Vaelatern Vaelatern removed the needs-testing Testing a PR or reproducing an issue needed label Jan 2, 2025
@Vaelatern
Copy link
Member Author

And this problem is also present on Alpine. @ncopa

Skimmed the build itself, it's heavily indirected Make.

@classabbyamp
Copy link
Member

this also happens with nsswitch.so, static.so, and umich_ldap.so in the same dir

@classabbyamp
Copy link
Member

can confirm it also happens on chimera, too

@classabbyamp
Copy link
Member

ok, this isn't underlinking but dracut trying to find dependencies for something that should only be loaded as a plugin, not as a standalone library. reported to upstream: dracut-ng/dracut-ng#1087

@jozzsi
Copy link

jozzsi commented Jan 4, 2025

Can somebody please help and test this speculative fix - dracut-ng/dracut-ng#1088 ?

@Vaelatern
Copy link
Member Author

Attempting a test on the rig where I detected the problem for starters. It's a big one and unwieldy and I did it with a manual sed but I'll see if I get results.

@Vaelatern
Copy link
Member Author

Negative @jozzsi

--- /usr/lib/dracut/modules.d/95nfs/module-setup.sh.bck 2025-01-05 07:52:19.142252800 +0000
+++ /usr/lib/dracut/modules.d/95nfs/module-setup.sh     2025-01-05 07:52:19.144252826 +0000
@@ -94,7 +94,7 @@
         echo "alias nfs4 nfs" > "$initdir"/etc/modprobe.d/nfs.conf
     fi

-    inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
+    inst_libdir_file -o 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'

     _nsslibs=$(
         cat "$dracutsysrootdir"/{,usr/}etc/nsswitch.conf 2> /dev/null \
dracut-install: ERROR: 'ldd /var/tmp/dracut.Ju4kiT/initramfs/usr/lib/libnfsidmap/nsswitch.so' failed with 141
dracut-install: ERROR: 'ldd /var/tmp/dracut.Ju4kiT/initramfs/usr/lib/libnfsidmap/static.so' failed with 141
dracut-install: ERROR: 'ldd /var/tmp/dracut.Ju4kiT/initramfs/usr/lib/libnfsidmap/umich_ldap.so' failed with 127
dracut-install: ERROR: 'ldd /var/tmp/dracut.Ju4kiT/initramfs/usr/lib/libnfsidmap/regex.so' failed with 141

@jozzsi
Copy link

jozzsi commented Jan 5, 2025

@Vaelatern Thanks for helping debugging this issue that probably has been there over 10 years.

I will need more help as I am not yet able to reproduce this environment in the dracut test suite.

1./ Can you please confirm that omitting nfs module (e.g. -o nfs on command line or omit_dracutmodules+=" nfs " in a dracut config file a workaround ? Does void-mklive needs nfs module to function properly ?

2./ Speculatively would commenting out the following line in dracut.sh resolve it/make a difference ?

#[[ "$dracutsysrootdir" ]] || [[ "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1"  

The goal is to make sure that DRACUT_RESOLVE_LAZY is NOT set.

@Vaelatern
Copy link
Member Author

  1. Yes I can confirm that omitting nfs does work.

  2. Where is this file?

@slymattz
Copy link
Contributor

slymattz commented Jan 7, 2025

  1. /usr/bin/dracut: Bourne-Again shell script, ASCII text executable. This file has exactly what @jozzsi wrote in line 1337.

@Vaelatern
Copy link
Member Author

@jozzsi

--- /usr/bin/dracut.bck 2025-01-07 20:00:00.326868228 +0000
+++ /usr/bin/dracut     2025-01-07 20:00:00.329868267 +0000
@@ -1334,7 +1334,6 @@
     mkdir "$early_cpio_dir"
 fi

-[[ "$dracutsysrootdir" ]] || [[ "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1"

 if [[ $print_cmdline ]]; then
     stdloglvl=0
dracut[I]: Executing: /usr/bin/dracut -N --zstd --add-drivers ahci --force-add "vmklive livenet autoinstaller" -
-omit systemd /boot/initrd-lts 6.1.114_2
...
dracut[I]: *** Including module: nfs ***
dracut-install: ERROR: failed to install '/lib/libnfsidmap/nsswitch.so:' for '/lib/libnfsidmap/nsswitch.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/nsswitch.so:' for '/lib/libnfsidmap/nsswitch.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/nsswitch.so:' for '/lib/libnfsidmap/nsswitch.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/nsswitch.so:' for '/lib/libnfsidmap/nsswitch.so'
dracut-install: ERROR: 'ldd /lib/libnfsidmap/nsswitch.so' failed with 127
dracut-install: ERROR: installing '/lib/libnfsidmap/nsswitch.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/regex.so:' for '/lib/libnfsidmap/regex.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/regex.so:' for '/lib/libnfsidmap/regex.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/regex.so:' for '/lib/libnfsidmap/regex.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/regex.so:' for '/lib/libnfsidmap/regex.so'
dracut-install: ERROR: 'ldd /lib/libnfsidmap/regex.so' failed with 127
dracut-install: ERROR: installing '/lib/libnfsidmap/regex.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/static.so:' for '/lib/libnfsidmap/static.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/static.so:' for '/lib/libnfsidmap/static.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/static.so:' for '/lib/libnfsidmap/static.so'
dracut-install: ERROR: 'ldd /lib/libnfsidmap/static.so' failed with 127
dracut-install: ERROR: installing '/lib/libnfsidmap/static.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/umich_ldap.so:' for '/lib/libnfsidmap/umich_ldap.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/umich_ldap.so:' for '/lib/libnfsidmap/umich_ldap.so'
dracut-install: ERROR: failed to install '/lib/libnfsidmap/umich_ldap.so:' for '/lib/libnfsidmap/umich_ldap.so'
dracut-install: ERROR: 'ldd /lib/libnfsidmap/umich_ldap.so' failed with 127
dracut-install: ERROR: installing '/lib/libnfsidmap/umich_ldap.so'
dracut-install: ERROR: failed to install '/usr/lib/libnfsidmap/nsswitch.so:' for '/usr/lib/libnfsidmap/nsswitch.
so'
dracut-install: ERROR: failed to install '/usr/lib/libnfsidmap/nsswitch.so:' for '/usr/lib/libnfsidmap/nsswitch.
so'
dracut-install: ERROR: failed to install '/usr/lib/libnfsidmap/nsswitch.so:' for '/usr/lib/libnfsidmap/nsswitch.
so'
dracut-install: ERROR: failed to install '/usr/lib/libnfsidmap/nsswitch.so:' for '/usr/lib/libnfsidmap/nsswitch.
so'
dracut-install: ERROR: 'ldd /usr/lib/libnfsidmap/nsswitch.so' failed with 127
....

and then...

...
dracut[E]: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.vx2Sf7/initramfs -a -l /lib/libnfsidmap/nsswitch.so /lib/libnfsidmap/regex.so /lib/libnfsidmap/static.so /lib/libnfsidmap/umich_ldap.so /lib/libnfsidmap.so /lib/libnfsidmap.so.1 /lib/libnfsidmap.so.1.0.0 /usr/lib/libnfsidmap/nsswitch.so /usr/lib/libnfsidmap/regex.so
/usr/lib/libnfsidmap/static.so /usr/lib/libnfsidmap/umich_ldap.so /usr/lib/libnfsidmap.so /usr/lib/libnfsidmap.so.1 /usr/lib/libnfsidmap.so.1.0.0
dracut[I]: *** Including module: nvmf ***
dracut[I]: *** Including module: resume ***
dracut[I]: *** Including module: rootfs-block ***
dracut[I]: *** Including module: terminfo ***
dracut[I]: *** Including module: udev-rules ***
dracut[I]: *** Including module: virtiofs ***
dracut[I]: *** Including module: usrmount ***
dracut[I]: *** Including module: base ***
dracut[I]: *** Including module: fs-lib ***
dracut[I]: *** Including module: img-lib ***
dracut[I]: *** Including module: shutdown ***
dracut[I]: *** Including modules done ***
dracut[I]: *** Installing kernel module dependencies ***
dracut[I]: *** Installing kernel module dependencies done ***
dracut[I]: *** Hardlinking files ***
dracut[I]: *** Hardlinking files done ***
dracut[I]: *** Generating early-microcode cpio image ***
dracut[I]: *** Constructing AuthenticAMD.bin ***
dracut[I]: *** Constructing GenuineIntel.bin ***
dracut[I]: *** Store current command line parameters ***
dracut[I]: *** Stripping files ***
dracut[I]: *** Stripping files done ***
dracut[I]: *** Creating image file '/boot/initrd-lts' ***

So it seems to operate while it shouts loudly about the plugins.

@jozzsi
Copy link

jozzsi commented Jan 7, 2025

So it seems to operate while it shouts loudly about the plugins.

Thanks. We can try to detect musl (or ldd/ldconfig version/info) and do not set DRACUT_RESOLVE_LAZY. Is there a recommended way for void to do the detection ?

@Vaelatern
Copy link
Member Author

ldd 2>&1 | grep musl looks to function. Not recommended but.

Maybe just unset it for the nfs module?

@jozzsi
Copy link

jozzsi commented Jan 7, 2025

ldd 2>&1 | grep musl looks to function. Not recommended but.

Maybe just unset it for the nfs module?

Can you please help verifying this patch - dracut-ng/dracut-ng@7f2d93b

@Vaelatern
Copy link
Member Author

@jozzsi Patch verified. It errors wildly and complains about errors, and failing but does successfully emit an image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants