[Bug 1912652] Re: Upgrading libc6-lse breaks on systems it is in use

Balint Reczey 1912652 at bugs.launchpad.net
Thu Apr 22 15:04:48 UTC 2021


Verified glibc 2.31-0ubuntu9.3 on Focal.

root at ff-lp1912652:~# gcc -O2 -o a.out a.c -lpthread -DITER=1000 -DTHREADS=64
root at ff-lp1912652:~# time ./a.out 
thread 0: min=128, max=390014464, average=15175.931641, mutexes_locked=224170, flips=12
...
thread 63: min=128, max=212314560, average=31851.539062, mutexes_locked=105648, flips=1
server: min=128, max=249241888, average=581391.875000, mutexes_locked=6158, flips=1000

real	0m0.938s
user	0m7.363s
sys	0m0.064s
root at ff-lp1912652:~# apt install libc6-lse
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libc6-lse
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1035 kB of archives.
After this operation, 3244 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libc6-lse arm64 2.31-0ubuntu9.2 [1035 kB]
Fetched 1035 kB in 1s (1393 kB/s)   
Selecting previously unselected package libc6-lse:arm64.
(Reading database ... 35769 files and directories currently installed.)
Preparing to unpack .../libc6-lse_2.31-0ubuntu9.2_arm64.deb ...
Unpacking libc6-lse:arm64 (2.31-0ubuntu9.2) ...
Setting up libc6-lse:arm64 (2.31-0ubuntu9.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
root at ff-lp1912652:~# reboot

Session terminated, killing shell... ...killed.
ubuntu at ip-172-31-20-158:~$ lxc shell ff-lp1912652 
root at ff-lp1912652:~# time ./a.out 
thread 0: min=128, max=1119296, average=20925.992188, mutexes_locked=1371, flips=36
...thread 61: min=128, max=15716704, average=295146.343750, mutexes_locked=96, flips=0
thread 62: min=1000000, max=12458848, average=12458848.000000, mutexes_locked=1, flips=0
thread 63: min=128, max=9601760, average=27332.921875, mutexes_locked=1255, flips=9
server: min=128, max=5040224, average=19802.298828, mutexes_locked=1437, flips=1000

real	0m0.014s
user	0m0.023s
sys	0m0.059s
root at ff-lp1912652:~# apt install libc-bin libc-dev-bin libc6 libc6-dev locales
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  glibc-doc
The following packages will be REMOVED:
  libc6-lse
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6 libc6-dev locales
5 upgraded, 0 newly installed, 1 to remove and 12 not upgraded.
Need to get 8770 kB of archives.
After this operation, 3159 kB disk space will be freed.
Do you want to continue? [Y/n] 
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main arm64 libc6-dev arm64 2.31-0ubuntu9.3 [2068 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main arm64 libc-dev-bin arm64 2.31-0ubuntu9.3 [64.2 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main arm64 libc6 arm64 2.31-0ubuntu9.3 [2270 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main arm64 locales all 2.31-0ubuntu9.3 [3862 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports focal-proposed/main arm64 libc-bin arm64 2.31-0ubuntu9.3 [506 kB]
Fetched 8770 kB in 1s (7065 kB/s) 
Preconfiguring packages ...
(Reading database ... 35813 files and directories currently installed.)
Removing libc6-lse:arm64 (2.31-0ubuntu9.2) ...
(Reading database ... 35769 files and directories currently installed.)
Preparing to unpack .../libc6-dev_2.31-0ubuntu9.3_arm64.deb ...
Unpacking libc6-dev:arm64 (2.31-0ubuntu9.3) over (2.31-0ubuntu9.2) ...
Preparing to unpack .../libc-dev-bin_2.31-0ubuntu9.3_arm64.deb ...
Unpacking libc-dev-bin (2.31-0ubuntu9.3) over (2.31-0ubuntu9.2) ...
Preparing to unpack .../libc6_2.31-0ubuntu9.3_arm64.deb ...
Unpacking libc6:arm64 (2.31-0ubuntu9.3) over (2.31-0ubuntu9.2) ...
Setting up libc6:arm64 (2.31-0ubuntu9.3) ...
(Reading database ... 35769 files and directories currently installed.)
Preparing to unpack .../locales_2.31-0ubuntu9.3_all.deb ...
Unpacking locales (2.31-0ubuntu9.3) over (2.31-0ubuntu9.2) ...
Preparing to unpack .../libc-bin_2.31-0ubuntu9.3_arm64.deb ...
Unpacking libc-bin (2.31-0ubuntu9.3) over (2.31-0ubuntu9.2) ...
Setting up libc-bin (2.31-0ubuntu9.3) ...
Setting up locales (2.31-0ubuntu9.3) ...
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
Setting up libc-dev-bin (2.31-0ubuntu9.3) ...
Setting up libc6-dev:arm64 (2.31-0ubuntu9.3) ...
Processing triggers for man-db (2.9.1-1) ...
root at ff-lp1912652:~# time ./a.out 
thread 0: min=128, max=2640064, average=19436.712891, mutexes_locked=1334, flips=31
thread 1: min=128, max=2480992, average=13251.751953, mutexes_locked=2115, flips=53
...

thread 62: min=128, max=112618720, average=94604.898438, mutexes_locked=2004, flips=25
thread 63: min=128, max=129409344, average=88098.539062, mutexes_locked=3266, flips=14
server: min=128, max=94762112, average=140166.890625, mutexes_locked=1347, flips=1000

real	0m0.080s
user	0m0.181s
sys	0m0.441s
root at ff-lp1912652:~# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version         Architecture Description
+++-==============-===============-============-=================================
ii  libc6:arm64    2.31-0ubuntu9.3 arm64        GNU C Library: Shared libraries
root at ff-lp1912652:~# 



** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1912652

Title:
  Upgrading libc6-lse breaks on systems it is in use

Status in glibc package in Ubuntu:
  Fix Released
Status in ubuntu-release-upgrader package in Ubuntu:
  Confirmed
Status in glibc source package in Bionic:
  New
Status in ubuntu-release-upgrader source package in Bionic:
  New
Status in glibc source package in Focal:
  Fix Committed
Status in ubuntu-release-upgrader source package in Focal:
  New
Status in glibc source package in Groovy:
  Fix Committed
Status in ubuntu-release-upgrader source package in Groovy:
  New
Status in glibc source package in Hirsute:
  Fix Released
Status in ubuntu-release-upgrader source package in Hirsute:
  Confirmed

Bug description:
  [Impact]

   * On arm64 systems supporting LSE and libc6-lse being installed an attempt to upgrade the package makes the upgrade fail and leave the system in an unusable state.
   * Performing a release upgrade on such arm64 systems also break if the libc6-lse package was installed and it is also present in the target release.

  [Test Plan (Focal)]

   * Set up an 8 core LSE system such as one of the AWS Graviton2 instances.
   * If libc6-lse is installed, remove it.
   * Compile and run the a.c test program attached in LP: #1885012 and measure the run time a few times.
     gcc -O2 -o a.out a.c -lpthread -DITER=1000 -DTHREADS=64
   * Install libc6-lse (again).
   * Reboot
   * Upgrade to the fixed libc6 package which Provides libc6-lse.
   * The upgrade should succeed and remove the libc6-lse package.
   * Run the compiled a.c again and observe it running much faster than with the standard libc6 package.

  [Test Plan (Groovy)]

   * Groovy's libc6 is already compiled with -moutline-atomics by default, thus there is no need to verify that.
   * Set up an LSE system such as one of the AWS Graviton2 instances.
   * Install libc6-lse if it is not installed.
   * Reboot
   * Upgrade to the fixed libc6 package which Provides libc6-lse.
   * The upgrade should succeed and automatically remove the libc6-lse package.

  [Where problems could occur]

  * The fix is compiling libc6 with -moutline-atomics which is in use
  instead of shipping the libc6-lse separate binary package. Should
  there be any GCC bug it could cause problems.

  [Other Info (Focal)]

  * The positive side effect of merging libc6-lse to libc6 and enabling
  optimization is that on capable HW the default libc6 will take
  advantage of the LSE instructions and improve the performance without
  requiring the installation of the additional libc libraries.

  [Original Bug Text]

  Errors were encountered while processing:
   /var/cache/apt/archives/libc6_2.32-0ubuntu3_arm64.deb
  Exception during pm.DoInstall():  E:Sub-process /usr/bin/dpkg returned an error code (1)

  ProblemType: Package
  DistroRelease: Ubuntu 20.04
  Package: libc6 2.31-0ubuntu9.1
  ProcVersionSignature: Ubuntu 5.4.0-1035.37-aws 5.4.78
  Uname: Linux 5.4.0-1035-aws aarch64
  ApportVersion: 2.20.11-0ubuntu27.14
  Architecture: arm64
  CasperMD5CheckResult: skip
  Date: Thu Jan 21 16:19:53 2021
  Df:

  Dmesg:

  Ec2AMI: ami-0489277f0e9a94f8d
  Ec2AMIManifest: (unknown)
  Ec2AvailabilityZone: eu-central-1c
  Ec2InstanceType: t4g.micro
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  ErrorMessage: new libc6:arm64 package post-removal script subprocess returned error exit status 127
  Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2
  PythonDetails: N/A
  RelatedPackageVersions:
   dpkg 1.19.7ubuntu3
   apt  2.0.2ubuntu0.2
  SourcePackage: glibc
  Title: package libc6 2.31-0ubuntu9.1 failed to install/upgrade: new libc6:arm64 package post-removal script subprocess returned error exit status 127
  UpgradeStatus: Upgraded to focal on 2021-01-21 (0 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1912652/+subscriptions



More information about the foundations-bugs mailing list