[Bug 1958594] Re: Boot error: libgcc_s.so.1 must be installed for pthread_exit to work
Manikanta
1958594 at bugs.launchpad.net
Tue Dec 26 13:04:10 UTC 2023
we are still observing the issue even with initramfs-tools/now 0.140ubuntu13.1 pacakge with python 3.7 version.
do we need to upgrade any other packages to fix this issue?
--
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/1958594
Title:
Boot error: libgcc_s.so.1 must be installed for pthread_exit to work
Status in initramfs-tools package in Ubuntu:
Fix Released
Status in initramfs-tools source package in Jammy:
Fix Released
Bug description:
[Bug description]
On a jammy installation, which was upgraded from focal, after a full-
upgrade and a reboot,
I enter the LUKS password to decrypt the disk. Then I get the
following error:
libgcc_s.so.1 must be installed for pthread_exit to work
After the error is shown, the system asks for the password again
(which never works, always throwing the same error).
[Root cause]
I was able to decrypt the disk with the same password by booting from
a live usb. Which allowed further investigation.
The error shown in the LUKS password prompt menu comes from
https://github.com/bminor/glibc/blob/glibc-2.34/nptl/pthread_exit.c#L31-L32, which indeed shows that pthread_exit fails when libgcc_s.so.1 is missing.
From
https://git.launchpad.net/ubuntu/+source/initramfs-tools/tree/hook-functions?h=import/0.140ubuntu10#n260,
we noticed that libgcc_s.so.1 is only copied if
1) copy_exec is called for a binary directly linked to libgcc_s.so.1, or
2) copy_exec is called for a binary linked to libpthread
The cryptsetup initramfs hook, calls copy_exec for /sbin/cryptsetup,
which is linked to libargon2.so.1, which is linked to libpthread.so.0.
This covers case (2) above. As a consequence, libgcc_s.so.1 is copied
to the initrd image and the error reported here is not seen.
However, since glibc 2.34, libpthread is shipped within glibc, and the
binaries are no longer linked to libpthread.so.0. As a consequence, an
argon2 package built with glibc 2.32 will no longer be linked to
libpthread.so.0 and libgcc_s.so.1 will no longer be copied to the
initrd image. Triggering the reported error.
This can be verified in these two argon2 builds, from the same
sources, but with different glibc versions:
https://launchpad.net/ubuntu/+source/argon2/0~20171227-0.2build21.04.0/+build/21066610
https://launchpad.net/ubuntu/+source/argon2/0~20171227-0.2build22/+build/22255217
Still lvm2 is a seeded package, which Recommends thin-provisioning-
tools. thin-provisioning-tools ships a initramfs hook that calls
copy_exec for /usr/sbin/pdata_tools, which is directly linked to
libgcc_s.so.1. This covers the case (1) above and should suffice to
ensure the boot process works properly.
Since thin-provisioning-tools is just a recommends for lvm2, it could
be removed from the system (and indeed, for some reason, was not
present in my focal=>jammy installation). In this case, a new kernel
installation should trigger the reported error.
[Reproducer]
- Install jammy with a LUKS encrypted disk
- remove thin-provisioning-tools
- perform a full-upgrade (make sure the kernel was upgraded or run update-initramfs manually)
- reboot and verify you can no longer get past the decrypt password prompt screen
[Workaround]
A workaround for anyone affected would be to install thin-
provisioning-tools and run update-initramfs.
[Impact]
Users upgrading from focal to jammy will eventually be locked out of
their systems in case they are using LUKS encryption.
[Additional information]
While this issue is similar to
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1861757,
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950254, and
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950551,
This is a different bug, with a different root cause.
Thanks to sergiodj for the pairing session on the root cause analysis.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1958594/+subscriptions
More information about the foundations-bugs
mailing list