Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926330 - sys-libs/compiler-rt-sanitizers-17.0.6 - /.../tsd.h: error: returning variable QuarantineCache by reference requires holding mutex Mutex exclusively [
Summary: sys-libs/compiler-rt-sanitizers-17.0.6 - /.../tsd.h: error: returning variabl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-03-07 09:24 UTC by Toralf Förster
Modified: 2024-03-12 07:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,18.65 KB, text/plain)
2024-03-07 09:24 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,21.73 KB, text/plain)
2024-03-07 09:24 UTC, Toralf Förster
Details
environment (environment,160.81 KB, text/plain)
2024-03-07 09:24 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.12 KB, application/x-xz)
2024-03-07 09:24 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,20.55 KB, application/x-xz)
2024-03-07 09:24 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,57.92 KB, text/plain)
2024-03-07 09:24 UTC, Toralf Förster
Details
sys-libs:compiler-rt-sanitizers-17.0.6:20240307-082537.log.xz (sys-libs:compiler-rt-sanitizers-17.0.6:20240307-082537.log.xz,25.06 KB, application/x-xz)
2024-03-07 09:24 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,61.39 KB, application/x-xz)
2024-03-07 09:24 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-03-07 09:24:07 UTC
too long lines were shrinked:

[849/1141] /usr/lib/llvm/18/bin/x86_64-pc-linux-gnu-clang++  -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/../.. -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/include  -DNDEBUG -O2 -pipe -march=native
FAILED: lib/scudo/standalone/CMakeFiles/RTScudoStandaloneCWrappers.i386.dir/wrappers_c.cpp.o 
/usr/lib/llvm/18/bin/x86_64-pc-linux-gnu-clang++  -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/../.. -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/include  -DNDEBUG -O2 -pipe -march=native -fno-diagn
In file included from /var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/wrappers_c.cpp:14:
In file included from /var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/allocator_config.h:12:
In file included from /var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/combined.h:25:
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/tsd.h:74:12: error: returning variable 'QuarantineCache' by reference requires holding mutex 'Mutex' exclusively [-Werror,-Wthread-safety-reference-return]
   74 |     return QuarantineCache;
      |            ^

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_systemd_merged_usr-20240306-213002

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 18.1.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.0
Python 3.11.8
Available Rust versions:
  [1]   rust-bin-1.75.0 *
php cli (if any):

  HEAD of ::gentoo
commit a1c8bdb112a6ded3a823775437749952f1918c7e
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Wed Mar 6 21:34:42 2024 +0000

    2024-03-06 21:34:41 UTC

emerge -qpvO sys-libs/compiler-rt-sanitizers
[ebuild   R   ] sys-libs/compiler-rt-sanitizers-18.1.0  USE="asan cfi clang dfsan gwp-asan hwasan libfuzzer lsan memprof msan orc profile safestack scudo tsan ubsan verify-sig xray -debug (-shadowcallstack) -test" ABI_X86="32 (64)"
Comment 1 Toralf Förster gentoo-dev 2024-03-07 09:24:08 UTC
Created attachment 886869 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-03-07 09:24:09 UTC
Created attachment 886870 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-03-07 09:24:10 UTC
Created attachment 886871 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-03-07 09:24:12 UTC
Created attachment 886872 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-03-07 09:24:13 UTC
Created attachment 886873 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-03-07 09:24:14 UTC
Created attachment 886874 [details]
qlist-info.txt
Comment 7 Toralf Förster gentoo-dev 2024-03-07 09:24:15 UTC
Created attachment 886875 [details]
sys-libs:compiler-rt-sanitizers-17.0.6:20240307-082537.log.xz
Comment 8 Toralf Förster gentoo-dev 2024-03-07 09:24:16 UTC
Created attachment 886876 [details]
temp.tar.xz
Comment 9 Magnus Granberg gentoo-dev 2024-03-08 21:54:33 UTC
Hitting it on my ci system to
Comment 10 dwfreed 2024-03-08 22:11:30 UTC
LLVM 18.1 added this diagnostic.  This is the commit they applied to fix the resulting error there:

https://github.com/llvm/llvm-project/commit/ea2036e1e56b720d7da8d46f62263ba46c126522

Maybe see if this applies cleanly to 17.0.6?
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-10 14:38:13 UTC
$ rg -i werror /var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt | grep -i thread
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/cmake/config-ix.cmake:check_cxx_compiler_flag("-Werror -Wthread-safety" COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG)
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/cmake/config-ix.cmake:check_cxx_compiler_flag("-Werror -Wthread-safety-reference" COMPILER_RT_HAS_WTHREAD_SAFETY_REFERENCE_FLAG)
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/cmake/config-ix.cmake:check_cxx_compiler_flag("-Werror -Wthread-safety-beta" COMPILER_RT_HAS_WTHREAD_SAFETY_BETA_FLAG)
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-17.0.6/work/compiler-rt/lib/scudo/standalone/CMakeLists.txt:append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG -Werror=thread-safety

Let's just sed/patch these out for this release.
Comment 12 Larry the Git Cow gentoo-dev 2024-03-12 07:54:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5216a5babc967f8374e3fe6c6e631080977d33ce

commit 5216a5babc967f8374e3fe6c6e631080977d33ce
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-03-12 07:54:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-03-12 07:54:17 +0000

    sys-libs/compiler-rt-sanitizers: skip -Wthread-safety on older versions
    
    Too much pain to backport it, it's just that newer Clang got better at
    detecting these.
    
    Closes: https://bugs.gentoo.org/926330
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.7.ebuild | 3 +++
 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.6.ebuild | 3 +++
 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.ebuild | 3 +++
 3 files changed, 9 insertions(+)