[Bug 2054171] [NEW] dhcpcd hook breaks when using libc6-prof's libc.so.6
Gregory Szorc
2054171 at bugs.launchpad.net
Sat Feb 17 00:34:00 UTC 2024
Public bug reported:
I have the libc6-prof package installed to provide a frame pointer
enabled libc.so.6.
I have a custom configuration file in /etc/ld.so.conf.d putting
/lib/libc6-prof/x86_64-linux-gnu at the front of the dynamic linker
search paths. (I really like having frame pointers!)
This confuses the `multiarch_dir=$(ldd /usr/sbin/dhcpcd | sed -En
's;^.*/lib/([^/]+)/libc\.so\..*$;\1;p')` line in /usr/share/initramfs-
tools/hooks/dhcpcd because the libc.so.6 path is different.
Default ldd output:
```
ldd /usr/sbin/dhcpcd
linux-vdso.so.1 (0x00007fff9a735000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f50d2800000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f50d2400000)
/lib64/ld-linux-x86-64.so.2 (0x00007f50d2f27000)
```
My ldd output:
```
ldd /usr/sbin/dhcpcd
linux-vdso.so.1 (0x00007fff802db000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fce87e00000)
libc.so.6 => /lib/libc6-prof/x86_64-linux-gnu/libc.so.6 (0x00007fce87a00000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce88514000)
```
```
-libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f50d2400000)
+libc.so.6 => /lib/libc6-prof/x86_64-linux-gnu/libc.so.6 (0x00007fce87a00000)
```
When running the modified search paths, `ldd /usr/sbin/dhcpcd | sed -En
's;^.*/lib/([^/]+)/libc\.so\..*$;\1;p'` evaluates to an empty string and
exits 0. This results in `copy_exec "/usr/lib//dhcpcd/dev/udev.so"`,
which breaks that script.
This in turn breaks initramfs.
```
Processing triggers for linux-image-6.5.0-17-generic (6.5.0-17.17) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.5.0-17-generic
E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 1.
update-initramfs: failed for /boot/initrd.img-6.5.0-17-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.5.0-17-generic (--configure):
installed linux-image-6.5.0-17-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-6.5.0-17-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
```
I can work around the issue by hacking up the dhcpcd hook or by
modifying the dynamic link path search order, running `ldconfig`, then
`update-initramfs -u`.
** Affects: initramfs-tools (Ubuntu)
Importance: Undecided
Status: New
** Summary changed:
- dhcpcd breaks when using libc6-prof's libc.so.6
+ dhcpcd hook breaks when using libc6-prof's libc.so.6
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/2054171
Title:
dhcpcd hook breaks when using libc6-prof's libc.so.6
Status in initramfs-tools package in Ubuntu:
New
Bug description:
I have the libc6-prof package installed to provide a frame pointer
enabled libc.so.6.
I have a custom configuration file in /etc/ld.so.conf.d putting
/lib/libc6-prof/x86_64-linux-gnu at the front of the dynamic linker
search paths. (I really like having frame pointers!)
This confuses the `multiarch_dir=$(ldd /usr/sbin/dhcpcd | sed -En
's;^.*/lib/([^/]+)/libc\.so\..*$;\1;p')` line in /usr/share/initramfs-
tools/hooks/dhcpcd because the libc.so.6 path is different.
Default ldd output:
```
ldd /usr/sbin/dhcpcd
linux-vdso.so.1 (0x00007fff9a735000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f50d2800000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f50d2400000)
/lib64/ld-linux-x86-64.so.2 (0x00007f50d2f27000)
```
My ldd output:
```
ldd /usr/sbin/dhcpcd
linux-vdso.so.1 (0x00007fff802db000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fce87e00000)
libc.so.6 => /lib/libc6-prof/x86_64-linux-gnu/libc.so.6 (0x00007fce87a00000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce88514000)
```
```
-libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f50d2400000)
+libc.so.6 => /lib/libc6-prof/x86_64-linux-gnu/libc.so.6 (0x00007fce87a00000)
```
When running the modified search paths, `ldd /usr/sbin/dhcpcd | sed
-En 's;^.*/lib/([^/]+)/libc\.so\..*$;\1;p'` evaluates to an empty
string and exits 0. This results in `copy_exec
"/usr/lib//dhcpcd/dev/udev.so"`, which breaks that script.
This in turn breaks initramfs.
```
Processing triggers for linux-image-6.5.0-17-generic (6.5.0-17.17) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.5.0-17-generic
E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 1.
update-initramfs: failed for /boot/initrd.img-6.5.0-17-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.5.0-17-generic (--configure):
installed linux-image-6.5.0-17-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-6.5.0-17-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
```
I can work around the issue by hacking up the dhcpcd hook or by
modifying the dynamic link path search order, running `ldconfig`, then
`update-initramfs -u`.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2054171/+subscriptions
More information about the foundations-bugs
mailing list