/usr/share/initramfs-tools/hooks/plymouth failed with return 1 due to warning in ldd output

Bug #2046570 reported by Duncan Joly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Received the error after accepting an automatic system update. This is caused by ldd printing a warning about the user install libpng16.so.16:

```
$ env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
/usr/lib/x86_64-linux-gnu/plymouth//two-step.so: /usr/local/lib/x86_64-linux-gnu/libpng16.so.16: no version information available (required by /lib/x86_64-linux-gnu/libply-splash-graphics.so.5)
 linux-vdso.so.1 (0x00007ffc0f9fe000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f349dd70000)
 libply.so.5 => /lib/x86_64-linux-gnu/libply.so.5 (0x00007f349dd52000)
 libply-splash-core.so.5 => /lib/x86_64-linux-gnu/libply-splash-core.so.5 (0x00007f349dd2f000)
 libply-splash-graphics.so.5 => /lib/x86_64-linux-gnu/libply-splash-graphics.so.5 (0x00007f349dd1e000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f349daf6000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f349de84000)
 libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f349daca000)
 libpng16.so.16 => /usr/local/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f349da7e000)
 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f349da62000)
```

ProblemType: Package
DistroRelease: Ubuntu 22.04
Package: initramfs-tools 0.140ubuntu13.4
ProcVersionSignature: Ubuntu 6.2.0-34.34~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-34-generic x86_64
NonfreeKernelModules: lkp_Ubuntu_6_2_0_34_34_generic_99 wl zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
Date: Fri Dec 15 11:19:44 2023
ErrorMessage: installed initramfs-tools package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2023-10-11 (64 days ago)
InstallationMedia: Ubuntu 22.04.3 LTS "Jammy Jellyfish" - Release amd64 (20230807.2)
PackageArchitecture: all
Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 3.10.6-1~22.04
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.21.1ubuntu2.2
 apt 2.4.11
SourcePackage: initramfs-tools
Title: package initramfs-tools 0.140ubuntu13.4 failed to install/upgrade: installed initramfs-tools package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Duncan Joly (duncanjoly) wrote :
Revision history for this message
Duncan Joly (duncanjoly) wrote :

This is very similar to bug #2037879 but with a slightly different error title.
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2037879

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The relevant dpkg terminal log says:

E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.

Sadly there is no error message explaining the exit code 1. Can you edit /usr/share/initramfs-tools/hooks/plymouth and add "set -x" (without the quotes) to the script and then run update-initramfs to get more log output?

sudo nano /usr/share/initramfs-tools/hooks/plymouth
sudo update-initramfs -u

Please attach the output to the bug report then.

Changed in initramfs-tools (Ubuntu):
status: New → Incomplete
Revision history for this message
Duncan Joly (duncanjoly) wrote (last edit ):
Download full text (4.3 KiB)

I appended 'set -x' directly after the existing 'set -e' in plymouth, then ran 'sudo update-initramfs -u'. The result is attached in output.txt and written below:

update-initramfs: Generating /boot/initrd.img-6.2.0-34-generic
+ OPTION=FRAMEBUFFER
+ PREREQ=
+ prereqs
+ echo
+ exit 0
+ OPTION=FRAMEBUFFER
+ PREREQ=
+ . /usr/share/initramfs-tools/hook-functions
+ update-alternatives --query default.plymouth
+ sed -e /^Value:/!d -e s/^Value: \(.*\)/\1/
+ THEME_PATH=/usr/share/plymouth/themes/bgrt/bgrt.plymouth
+ basename /usr/share/plymouth/themes/bgrt/bgrt.plymouth .plymouth
+ THEME=bgrt
+ THEMES=/usr/share/plymouth/themes
+ [ -n /usr/share/plymouth/themes/bgrt/bgrt.plymouth ]
+ grep ImageDir *= * /usr/share/plymouth/themes/bgrt/bgrt.plymouth
+ sed s/ImageDir *= *//
+ IMAGE_PATH=/usr/share/plymouth/themes/spinner
+ [ -n /usr/share/plymouth/themes/spinner ]
+ [ /usr/share/plymouth/themes/bgrt/bgrt.plymouth != /usr/share/plymouth/themes/spinner ]
+ basename /usr/share/plymouth/themes/spinner
+ IMAGE_NAME=spinner
+ mkdir -p /var/tmp/mkinitramfs_SWWOCa//usr/share/plymouth/themes
+ [ -n bgrt ]
+ [ bgrt != none ]
+ THEME_NAME=bgrt
+ THEME=/usr/share/plymouth/themes/bgrt/bgrt.plymouth
+ ln -s /usr/share/plymouth/themes/bgrt/bgrt.plymouth /var/tmp/mkinitramfs_SWWOCa//usr/share/plymouth/themes/default.plymouth
+ plymouth --get-splash-plugin-path
+ PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/plymouth/
+ update-alternatives --query text.plymouth
+ sed -e /^Value:/!d -e s/^Value: \(.*\)/\1/
+ TEXTTHEME_PATH=/usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth
+ basename /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth .plymouth
+ TEXTTHEME=ubuntu-text
+ [ ubuntu-text != none ]
+ TEXTTHEME_NAME=ubuntu-text
+ TEXTTHEME=/usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth
+ + ln -s /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth /var/tmp/mkinitramfs_SWWOCa//usr/share/plymouth/themes/text.plymouth
[ -n ubuntu-text ]
+ [ ! -r /usr/share/plymouth/themes/bgrt/bgrt.plymouth ]
+ currthemes=bgrt ubuntu-text spinner
+ PLUGINS=details.so label.so
+ sed -n s/^ModuleName=\(.*\)/\1/p /usr/share/plymouth/themes/bgrt/bgrt.plymouth
+ MODULE=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ [ ! -e /usr/lib/x86_64-linux-gnu/plymouth//two-step.so ]
+ copy_exec /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ local src target x nonoptlib ret
+ src=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ target=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ copy_file binary /usr/lib/x86_64-linux-gnu/plymouth//two-step.so /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ local type src target link_target
+ type=binary
+ src=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ target=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ [ -f /usr/lib/x86_64-linux-gnu/plymouth//two-step.so ]
+ [ -d /var/tmp/mkinitramfs_SWWOCa//usr/lib/x86_64-linux-gnu/plymouth//two-step.so ]
+ [ -e /var/tmp/mkinitramfs_SWWOCa//usr/lib/x86_64-linux-gnu/plymouth//two-step.so ]
+ mkdir -p /var/tmp/mkinitramfs_SWWOCa//usr/lib/x86_64-linux-gnu/plymouth/
+ [ -h /usr/lib/x86_64-linux-gnu/plymouth//two-step.so ]
+ [ n = y ]
+ cp -pP /usr/lib/x86_64-linux-gnu/plymouth//two-step.so /var/...

Read more...

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thanks. That allows debugging. Which plymouth packages do you have installed? Please post the output of "dpkg -l | grep plymouth". Can you also post the output of "update-alternatives --query default.plymouth"?

Analysis:

The script uses the Value field from the "update-alternatives --query default.plymouth" output to determine the theme. In this case it's /usr/share/plymouth/themes/bgrt/bgrt.plymouth which then maps to THEME=bgrt and then to currthemes="bgrt ubuntu-text spinner". The failing code is:

for currtheme in $currthemes
do
 [...]
 MODULE="${PLUGIN_PATH}/$(sed -n 's/^ModuleName=\(.*\)/\1/p' ${THEMES}/${currtheme}/${currtheme}.plymouth 2>/dev/null || true).so"
 [...]
 # copy plugin and images for current theme
 copy_exec "${MODULE}"

The script derives MODULE=/usr/lib/x86_64-linux-gnu/plymouth//two-step.so from reading /usr/share/plymouth/themes/bgrt/bgrt.plymouth (which is shipped by plymouth-theme-spinner), but fails to copy /usr/lib/x86_64-linux-gnu/plymouth//two-step.so (which is shipped by plymouth-theme-spinner as well). The shipped files between focal and jammy hasn't changed.

So the installed plymouth-theme-spinner seems to be broken.

Revision history for this message
Duncan Joly (duncanjoly) wrote :

Sure!

$ dpkg -l | grep plymouth
ii libplymouth5:amd64 0.9.5+git20211018-1ubuntu3 amd64 graphical boot animation and logger - shared libraries
ii plymouth 0.9.5+git20211018-1ubuntu3 amd64 boot animation, logger and I/O multiplexer
ii plymouth-label 0.9.5+git20211018-1ubuntu3 amd64 boot animation, logger and I/O multiplexer - label control
ii plymouth-theme-spinner 0.9.5+git20211018-1ubuntu3 amd64 boot animation, logger and I/O multiplexer - spinner theme
ii plymouth-theme-ubuntu-text 0.9.5+git20211018-1ubuntu3 amd64 boot animation, logger and I/O multiplexer - ubuntu text theme

$ update-alternatives --query default.plymouth
Name: default.plymouth
Link: /usr/share/plymouth/themes/default.plymouth
Status: auto
Best: /usr/share/plymouth/themes/bgrt/bgrt.plymouth
Value: /usr/share/plymouth/themes/bgrt/bgrt.plymouth

Alternative: /usr/share/plymouth/themes/bgrt/bgrt.plymouth
Priority: 110

Revision history for this message
Benjamin Drung (bdrung) wrote :

The installed plymouth packages look correct and the default.plymouth is the default configuration.

Can you check with debsums if these packages are correctly installed?

sudo apt install debsums
debsums --silent plymouth plymouth-label plymouth-theme-spinner plymouth-theme-ubuntu-text

If they report failures, you ran re-install those packages (sudo apt install --reinstall $package).

Revision history for this message
Duncan Joly (duncanjoly) wrote :

The only output from debsums is that there's a change in /usr/share/initramfs-tools/hooks/plymouth, which of course is the 'set -x' that we added.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Now it gets into the strange territory. What is the output of "debsums plymouth-theme-spinner"? Can you "stat /usr/lib/x86_64-linux-gnu/plymouth/two-step.so" and "sha256sum /usr/lib/x86_64-linux-gnu/plymouth/two-step.so"?

Revision history for this message
Duncan Joly (duncanjoly) wrote :
Download full text (6.8 KiB)

$ debsums plymouth-theme-spinner
/usr/lib/x86_64-linux-gnu/plymouth/two-step.so OK
/usr/share/doc/plymouth-theme-spinner/copyright OK
/usr/share/plymouth/themes/bgrt/bgrt.plymouth OK
/usr/share/plymouth/themes/spinner/animation-0001.png OK
/usr/share/plymouth/themes/spinner/animation-0002.png OK
/usr/share/plymouth/themes/spinner/animation-0003.png OK
/usr/share/plymouth/themes/spinner/animation-0004.png OK
/usr/share/plymouth/themes/spinner/animation-0005.png OK
/usr/share/plymouth/themes/spinner/animation-0006.png OK
/usr/share/plymouth/themes/spinner/animation-0007.png OK
/usr/share/plymouth/themes/spinner/animation-0008.png OK
/usr/share/plymouth/themes/spinner/animation-0009.png OK
/usr/share/plymouth/themes/spinner/animation-0010.png OK
/usr/share/plymouth/themes/spinner/animation-0011.png OK
/usr/share/plymouth/themes/spinner/animation-0012.png OK
/usr/share/plymouth/themes/spinner/animation-0013.png OK
/usr/share/plymouth/themes/spinner/animation-0014.png OK
/usr/share/plymouth/themes/spinner/animation-0015.png OK
/usr/share/plymouth/themes/spinner/animation-0016.png OK
/usr/share/plymouth/themes/spinner/animation-0017.png OK
/usr/share/plymouth/themes/spinner/animation-0018.png OK
/usr/share/plymouth/themes/spinner/animation-0019.png OK
/usr/share/plymouth/themes/spinner/animation-0020.png OK
/usr/share/plymouth/themes/spinner/animation-0021.png OK
/usr/share/plymouth/themes/spinner/animation-0022.png OK
/usr/share/plymouth/themes/spinner/animation-0023.png OK
/usr/share/plymouth/themes/spinner/animation-0024.png OK
/usr/share/plymouth/themes/spinner/animation-0025.png OK
/usr/share/plymouth/themes/spinner/animation-0026.png OK
/usr/share/plymouth/themes/spinner/animation-0027.png OK
/usr/share/plymouth/themes/spinner/animation-0028.png OK
/usr/share/plymouth/themes/spinner/animation-0029.png OK
/usr/share/plymouth/themes/spinner/animation-0030.png OK
/usr/share/plymouth/themes/spinner/animation-0031.png OK
/usr/share/plymouth/themes/spinner/animation-0032.png OK
/usr/share/plymouth/themes/spinner/animation-0033.png OK
/usr/share/plymouth/themes/spinner/animation-0034.png OK
/usr/share/plymouth/themes/spinner/animation-0035.png OK
/usr/share/plymouth/themes/spinner/animation-0036.png OK
/usr/sha...

Read more...

Revision history for this message
Benjamin Drung (bdrung) wrote :

That looks correct. Is "sudo update-initramfs -u" still failing? If not, can you check /var/log/apt/history.log and /var/log/apt/term.log to figure out what ran since then?

Revision history for this message
Duncan Joly (duncanjoly) wrote :

It still fails with the same output as in comment #4.

Revision history for this message
Benjamin Drung (bdrung) wrote :

I tried to reproduce it in a chroot environment:

```
schroot-wrapper -p linux-image-6.2.0-34-generic,initramfs-tools,plymouth-theme-spinner,plymouth-theme-ubuntu-text,vim -u root -c jammy
echo FRAMEBUFFER=y >> /etc/initramfs-tools/initramfs.conf
vim /usr/share/initramfs-tools/hooks/plymouth
update-initramfs -u > log 2>&1
```

Then diffed the output:

```
sed -i 's/mkinitramfs_EXUmcb/mkinitramfs_SWWOCa/g' log
diff -u log comment-4.txt > log.diff
```

The output starts to differ from here. Your log:

```
+ env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ sed -e
  /\//!d;
  /linux-gate/d;
  /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
  s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/
+ echo /usr/lib/x86_64-linux-gnu/plymouth//two-step.so:
```

My log:

```
+ env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
+ sed -e
  /\//!d;
  /linux-gate/d;
  /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
  s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/
+ echo /lib/x86_64-linux-gnu/libm.so.6
```

Can you paste the output of `env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so` please?

Output in my chroot:

```
 linux-vdso.so.1 (0x00007ffdaff39000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4381028000)
 libply.so.5 => /lib/x86_64-linux-gnu/libply.so.5 (0x00007f438100a000)
 libply-splash-core.so.5 => /lib/x86_64-linux-gnu/libply-splash-core.so.5 (0x00007f4380fe7000)
 libply-splash-graphics.so.5 => /lib/x86_64-linux-gnu/libply-splash-graphics.so.5 (0x00007f4380fd6000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4380dae000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f4381128000)
 libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f4380d82000)
 libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f4380d47000)
 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4380d2b000)
```

Revision history for this message
Benjamin Drung (bdrung) wrote :

ldd comes from libc-bin. Can you tell me the libc-bin version and `sha256sum /usr/bin/ldd`?

Revision history for this message
Duncan Joly (duncanjoly) wrote :

$ env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
/usr/lib/x86_64-linux-gnu/plymouth//two-step.so: /usr/local/lib/x86_64-linux-gnu/libpng16.so.16: no version information available (required by /lib/x86_64-linux-gnu/libply-splash-graphics.so.5)
 linux-vdso.so.1 (0x00007ffc0f9fe000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f349dd70000)
 libply.so.5 => /lib/x86_64-linux-gnu/libply.so.5 (0x00007f349dd52000)
 libply-splash-core.so.5 => /lib/x86_64-linux-gnu/libply-splash-core.so.5 (0x00007f349dd2f000)
 libply-splash-graphics.so.5 => /lib/x86_64-linux-gnu/libply-splash-graphics.so.5 (0x00007f349dd1e000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f349daf6000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f349de84000)
 libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f349daca000)
 libpng16.so.16 => /usr/local/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f349da7e000)
 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f349da62000)

$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.35-0ubuntu3.5) stable release version 2.35.
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 11.4.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

$ sha256sum /usr/bin/ldd
66e9c5fed478b359116104c2a737eb9508290843330aef0516c7c2079e9f378e /usr/bin/ldd

Revision history for this message
Benjamin Drung (bdrung) wrote :

There we found it. ldd prints a warning and the initramfs-tools shell code stumbles upon it:

/usr/lib/x86_64-linux-gnu/plymouth//two-step.so: /usr/local/lib/x86_64-linux-gnu/libpng16.so.16: no version information available (required by /lib/x86_64-linux-gnu/libply-splash-graphics.so.5)

Can you check if that output is printed on stdout or stderr? "env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so > /dev/null"

Changed in initramfs-tools (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → Low
summary: - package initramfs-tools 0.140ubuntu13.4 failed to install/upgrade:
- installed initramfs-tools package post-installation script subprocess
- returned error exit status 1
+ /usr/share/initramfs-tools/hooks/plymouth failed with return 1 due to
+ warning in ldd output
Revision history for this message
Benjamin Drung (bdrung) wrote :

Can you attach /usr/local/lib/x86_64-linux-gnu/libpng16.so.16 to this bug report? Then I can test the fix for it.

Revision history for this message
Duncan Joly (duncanjoly) wrote :

The output was printed on stdout as it was redirected with > and not 2>.
Please find the requested file attached.

Benjamin Drung (bdrung)
description: updated
Revision history for this message
Benjamin Drung (bdrung) wrote :

Thanks for helping debugging it. I could reproduce it after placing your library into /usr/local/lib/x86_64-linux-gnu/libpng16.so.16 and running ldconfig.

It will be fixed in the upcoming Ubuntu release. The fix: https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/commit/?id=e6ee680de31442ba54e73d3221c37804b9e0ddce

You can apply the fix by editing /usr/share/initramfs-tools/hook-functions and adding "| grep -P '^\t' " after the ldd call.

Changed in initramfs-tools (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Benjamin Drung (bdrung) wrote :
Revision history for this message
Duncan Joly (duncanjoly) wrote :

Thanks, Benjamin!

Revision history for this message
Duncan Joly (duncanjoly) wrote :

I just made the fix but it still doesn't work. The issue seems to be that the script tries to execute the command '4972' which of course is not found. I've attached the stderr output of 'sudo update-initramfs -u' in '127.txt'.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.142ubuntu19

---------------
initramfs-tools (0.142ubuntu19) noble; urgency=medium

  * copy_exec: ignore ldd output lines not starting with a tab (LP: #2046570)

 -- Benjamin Drung <email address hidden> Tue, 19 Dec 2023 15:28:14 +0100

Changed in initramfs-tools (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Benjamin Drung (bdrung) wrote :

That error message looks like '4972' was accidentally added to /usr/share/initramfs-tools/hooks/plymouth. Can you restore the content of the file by reinstalling it?

sudo apt install --reinstall plymouth

Revision history for this message
Duncan Joly (duncanjoly) wrote :

Yes, that fixed it. Thank you for the help.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.