Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 807007

Summary: sys-devel/clang-12.0.0-r1 or sys-devel/llvm-12.0.1: sanitizer reports error in DWARF tables of produced binaries
Product: Gentoo Linux Reporter: a.b
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED UPSTREAM    
Severity: normal CC: herrtimson
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: sample code that produces the error

Description a.b 2021-08-07 14:27:18 UTC
Created attachment 731206 [details]
sample code that produces the error

It looks like the clang build of my gentoo is partially broken. I have been told that the error doesn't happen on another distro with same clang version.

The following error message shows up when building with clang++ the provided C++ code with address sanitizer enabled:

error: address range table at offset 0x3bc70 has a premature terminator entry at offset 0x3bc80

Error triggered by: https://github.com/llvm/llvm-project/blob/main/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp#L148

---

Reproduction:

1. compile the attached code with clang++-12 -fsanitize=address -std=c++17 -lSDL2
2. execute the produced executable and look for an error: 2>&1 | grep error

emerge --info sys-devel/clang sys-devel/llvm:
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/hardened, gcc-10.3.0, glibc-2.33-r1, 5.10.52-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.52-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i9-10900T_CPU_@_1.90GHz-with-glibc2.33
KiB Mem:    48144712 total,  33989032 free
KiB Swap:    3145724 total,   1577308 free
Timestamp of repository gentoo: Fri, 06 Aug 2021 23:30:01 +0000
Head commit of repository gentoo: fecee9ac333f9d195e2a1bedd6683eb299140074
Timestamp of repository dm9pZCAq: Fri, 06 Aug 2021 00:21:03 +0000
Head commit of repository dm9pZCAq: d79da81b0c48b1cd83369135c74602c0d1d1298e

Timestamp of repository guru: Tue, 03 Aug 2021 11:36:57 +0000
Head commit of repository guru: 146e32472bf4dbab8c00937a5eaf727c3c40f1bd

Timestamp of repository monero: Sat, 17 Jul 2021 10:36:51 +0000
Head commit of repository monero: 63b177d56e34bc38b39b917519b8fdfc5afe0418

Timestamp of repository pf4public: Fri, 06 Aug 2021 19:08:18 +0000
Head commit of repository pf4public: daa5b75055260d1b96fcb54a575fd81f99a8d0cf

Timestamp of repository steam-overlay: Wed, 04 Aug 2021 22:21:33 +0000
Head commit of repository steam-overlay: 2faa1fc890182c72a34c69846154e1b2d164c4f9

Timestamp of repository torbrowser: Tue, 03 Aug 2021 11:36:50 +0000
Head commit of repository torbrowser: a19004cd103252e33b515319df1acb22c9e1b83e

sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
ccache version 4.3 [enabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.8.11::gentoo, 3.9.6_p1::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/ccache:          4.3-r2::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

dm9pZCAq
    location: /var/db/repos/dm9pZCAq
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dm9pZCAq.git
    masters: gentoo

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo

monero
    location: /var/db/repos/monero
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/monero.git
    masters: gentoo

pf4public
    location: /var/db/repos/pf4public
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pf4public.git
    masters: gentoo

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

torbrowser
    location: /var/db/repos/torbrowser
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/torbrowser.git
    masters: gentoo

Installed sets: @base_system, @creduce-deps, @desktop-apps, @desktop-fonts, @desktop-sway, @dev-tools, @emulation, @fusee-launcher, @games, @inadyn, @llvm-git, @monero, @multimedia, @ranger, @services, @terminal-apps
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CC="ccache clang"
CFLAGS="-march=native -mtune=native -O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXX="ccache clang++"
CXXFLAGS="-march=native -mtune=native -O2 -pipe -ggdb"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -mtune=native -O2 -pipe -ggdb"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy ccache compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles installsources ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mtune=native -O2 -pipe -ggdb"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j20 -l20"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi adns alsa amd64 bash-completion branding bzip2 cairo caps cdda cdr cjk crypt cups dbus djvu dnssec doc dri dts dvd dvdr elogind emboss encode exif fam flac gif gimp git gnutls gpm graphite gtk gui hardened iconv icu iproute2 ipv6 jpeg lcms libglvnd libnotify libtirpc lm-sensors logrotate lto mad mktemp mng modern-top mp3 mp4 mpeg mtp multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf pgo pie plymouth png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr ssl ssp startup-notification svg syslog threads tiff truetype udev udisks unicode upower usb utempter vaapi verify-sig vim-syntax vorbis vulkan wayland wxwidgets x264 xattr xcb xml xscreensaver xtpax xv xvid zeroconf zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="WebAssembly" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="i915 i965 intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

sys-devel/clang-12.0.1::gentoo was built with the following:
USE="doc static-analyzer xml -debug -default-compiler-rt -default-libcxx -default-lld -llvm-libunwind -test" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="WebAssembly (X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF (-CSKY) -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -XCore" PYTHON_SINGLE_TARGET="python3_9 (-python3_10) -python3_8"
FEATURES="binpkg-docompress unmerge-logs config-protect-if-modified parallel-fetch unknown-features-warn merge-sync news sfperms userpriv preserve-libs binpkg-dostrip pid-sandbox parallel-install compressdebug usersandbox assume-digests candy multilib-strict network-sandbox installsources sandbox userfetch unmerge-orphans ccache ipc-sandbox strict xattr distlocks ebuild-locks fixlafiles qa-unresolved-soname-deps binpkg-logs usersync splitdebug protect-owned"


sys-devel/llvm-12.0.1::gentoo was built with the following:
USE="doc gold libffi ncurses xml -debug -exegesis -libedit -test -xar -z3" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="WebAssembly (X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF (-CSKY) -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -XCore"
FEATURES="ipc-sandbox qa-unresolved-soname-deps pid-sandbox parallel-fetch binpkg-logs unmerge-logs compressdebug binpkg-dostrip network-sandbox assume-digests binpkg-docompress ebuild-locks preserve-libs usersync ccache userpriv installsources userfetch multilib-strict strict unmerge-orphans protect-owned fixlafiles news distlocks splitdebug usersandbox sandbox config-protect-if-modified unknown-features-warn sfperms merge-sync candy parallel-install xattr"


sys-devel/llvm-13.0.0.9999-r0::local was built with the following:
USE="doc gold libffi ncurses xml -debug -exegesis -libedit -test -xar -z3" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="WebAssembly (X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -Hexagon -Lanai (-M68k) -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -XCore"
FEATURES="sfperms ipc-sandbox usersync protect-owned binpkg-logs merge-sync unknown-features-warn splitdebug unmerge-logs compressdebug unmerge-orphans ccache news assume-digests qa-unresolved-soname-deps sandbox usersandbox xattr config-protect-if-modified ebuild-locks binpkg-docompress installsources pid-sandbox userpriv candy userfetch binpkg-dostrip strict distlocks parallel-install preserve-libs multilib-strict fixlafiles network-sandbox parallel-fetch"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-18 08:10:55 UTC
This would be something to report upstream. We don't do anything special at that sort of level.