SRU: Fix libtsan0 (10.5.0-1ubuntu1~20.04) missing libtsan_preinit.o

Bug #2029910 reported by Anton Martinsen
76
This bug affects 12 people
Affects Status Importance Assigned to Milestone
gcc-9 (Ubuntu)
Confirmed
Undecided
Unassigned
Focal
Fix Committed
Undecided
Unassigned

Bug Description

The libtsan0 package built from gcc-10 used to ship the libtsan_preinit.o file in the shared library package libtsan0. That was correctly fixed with the update to GCC 10.5.0, moving it into libgcc-10-dev's private GCC libdir, however then making it unavailable for gcc-9. This patch ships the .o file in libgcc-9-dev as well.

Test case:
echo "int main(){}" | gcc -fsanitize=thread -x c -

fails linking before the fix, and succeeds after.

The regression potential is low, there are no changes to code, and the change only affects the thread sanitizer which is not in use by default.

The packages are pre-built in a PPA with just the security pocket enabled.

Original report:
================

When running sudo apt-get install libtsan0, the file libtsan_preinit.o which is supposed to be installed is not installed.

I had to compile it from gcc source code and add it manually.

I am running unfortunately running Pop!
But the same issue happens on my friends Ubuntu.
And it has been re-created on several Docker images of Ubuntu 20.04.

$ lsb_release -rd
Description: Pop!_OS 20.04 LTS
Release: 20.04

$ apt-cache policy libtsan0
libtsan0:
  Installed: 10.5.0-1ubuntu1~20.04
  Candidate: 10.5.0-1ubuntu1~20.04
  Version table:
 *** 10.5.0-1ubuntu1~20.04 500
        500 http://us.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     10-20200411-0ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Let me know if you need any more info or if this is sufficient to re-create the issue.

Best regards,
A

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-10 (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert N (bert-n) wrote :

Can confirm - the file in question is simply not contained in the archive in question for version 10.5.0 (e.g. https://packages.ubuntu.com/focal/amd64/libtsan0/download)

Revision history for this message
Maxim Egorushkin (max0x7ba) wrote (last edit ):

I hit this bug in Ubuntu-20.04 in Github actions environment: https://github.com/orgs/community/discussions/63391

Revision history for this message
Clément Peron (peron-clem) wrote (last edit ):

I also hit this bug on Ubuntu 20.04.

@Matthias Klose

It seems to come from the merge with latest Debian upstream

The changelog mention this: + * Fix libtsan0 build (when building the libs built by newer GCC versions).

And the binary-libtsan.mk remove the libtsan_preinit.o

- $(usr_lib$(2))/libtsan.so.* \
- $(usr_lib$(2))/libtsan_preinit.o
+ $(usr_lib$(2))/libtsan.so.*

Revision history for this message
Matthias Klose (doko) wrote :

please install libgcc-10-dev

$ dpkg -S libtsan_preinit.o
libgcc-10-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/10/libtsan_preinit.o

the libtsan0 package only contains the shared runtime library

Revision history for this message
Matthias Klose (doko) wrote :

however if you have the default gcc/g++ installed, the file should be available by default.

Revision history for this message
Markus (greenrobot42) wrote :

Just wanted to note that this also happens on an aarch64 Ubuntu 20.04 image with default versions (build-essentials installed).

# gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

Revision history for this message
Matthias Klose (doko) wrote :

confirmed, needs an update, however cant't do that immediately

Changed in gcc-10 (Ubuntu Focal):
status: New → Confirmed
Revision history for this message
Clément Peron (peron-clem) wrote (last edit ):

@doko I tested with libgcc-9-dev on both AMD64 and ARM64 Ubuntu 20.04 but It doesn't fix the issue :(

$> sudo apt intall libgcc-9-dev
$> dpkg -S libtsan_preinit.o
0.257 dpkg-query: no path found matching pattern *libtsan_preinit.o*

Dockerfile

```
from ubuntu:20.04

RUN apt update && apt install -y gcc libgcc-9-dev

RUN uname -m && gcc --version

RUN echo "int main(){}" | gcc -fsanitize=thread -x c -
```

$> docker --platform XXXX build .

#7 [3/4] RUN uname -m && gcc --version
#7 0.153 x86_64 / aarch64
#7 0.175 gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

 > [4/4] RUN echo "int main(){}" | gcc -fsanitize=thread -x c -:
0.205 /usr/bin/ld: cannot find libtsan_preinit.o: No such file or directory
0.205 collect2: error: ld returned 1 exit status

Matthias Klose (doko)
affects: gcc-10 (Ubuntu) → gcc-9 (Ubuntu)
Matthias Klose (doko)
summary: - libtsan0 (10.5.0-1ubuntu1~20.04) missing libtsan_preinit.o
+ SRU: Fix libtsan0 (10.5.0-1ubuntu1~20.04) missing libtsan_preinit.o
Matthias Klose (doko)
description: updated
Revision history for this message
Clément Peron (peron-clem) wrote :

Hi,

The bug still kick me, is there something I can do to fix the issue?

Thanks for your help,
Clement

Revision history for this message
Jean-Francois Simoneau (jfsimoneau) wrote :

I managed to go around the issue by extracting libtsan_preinit.o from libgcc-10-dev and manually installing it to /usr/lib/gcc/x86_64-linux-gnu/9/libtsan_preinit.o.

In a temporary directory:
apt-get download libgcc-10-dev
dpkg -x "libgcc-10-dev_10.5.0-1ubuntu1~20.04_amd64.deb" .
sudo cp usr/lib/gcc/x86_64-linux-gnu/10/libtsan_preinit.o /usr/lib/gcc/x86_64-linux-gnu/9/

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Anton, or anyone else affected,

Accepted gcc-9 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gcc-9/9.4.0-1ubuntu1~20.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gcc-9 (Ubuntu Focal):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (gcc-9/9.4.0-1ubuntu1~20.04.3)

All autopkgtests for the newly accepted gcc-9 (9.4.0-1ubuntu1~20.04.3) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

binutils/2.34-6ubuntu1.6 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#gcc-9

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Matthias Klose (doko) wrote :

- the file is included.
- the binutils autopkg test failure was transitional

tags: added: verification-done verification-needed-done
removed: verification-needed verification-needed-focal
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.