Created attachment 927701 [details] build.log (decompress with bzip2 -d) collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped Building the latest snapshot of clang with -flto=auto causes mold to crash not sure how to diagnose though so just leaving it here. Tried building mold without graphite and it still crashes Portage 3.0.68 (python 3.13.3-final-0, default/linux/amd64/23.0/no-multilib/hardened/systemd, gcc-15, glibc-2.41-r1, 6.14.5-gentoo-dist-hardened x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.14.5-gentoo-dist-hardened-x86_64-12th_Gen_Intel-R-_Core-TM-_i5-1235U-with-glibc2.41 KiB Mem: 11959712 total, 4485308 free KiB Swap: 8290300 total, 6326176 free Timestamp of repository gentoo: Mon, 05 May 2025 08:54:59 +0000 Head commit of repository gentoo: f46e8f6bc3645e4a59f4d59db8c2d315d194a39c Timestamp of repository guru: Sun, 04 May 2025 14:39:22 +0000 Head commit of repository guru: ea6df2f0cbf1716d6ba2b23f6f72ca2d9309bcf3 sh bash 5.2_p37-r2 ld GNU ld (Gentoo 2.44 p1) 2.44.0 app-misc/pax-utils: 1.3.8::gentoo app-shells/bash: 5.2_p37-r2::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.72-r1::gentoo dev-build/automake: 1.17-r2::gentoo dev-build/cmake: 3.31.7::gentoo dev-build/libtool: 2.5.4::gentoo dev-build/make: 4.4.1-r100::gentoo dev-build/meson: 1.8.0::gentoo dev-lang/perl: 5.40.2::gentoo dev-lang/python: 3.12.10::gentoo, 3.13.3::gentoo dev-lang/rust-bin: 1.85.1::gentoo, 1.86.0-r1::gentoo llvm-core/clang: 19.1.7::gentoo, 21.0.0_pre20250503::gentoo llvm-core/lld: 21.0.0_pre20250503::gentoo llvm-core/llvm: 19.1.7::gentoo, 21.0.0_pre20250503::gentoo sys-apps/baselayout: 2.17::gentoo sys-apps/sandbox: 2.46::gentoo sys-apps/systemd: 257.5::gentoo sys-devel/binutils: 2.44::gentoo sys-devel/binutils-config: 5.5.2::gentoo sys-devel/gcc: 15.1.1_p20250503::gentoo sys-devel/gcc-config: 2.12.1::gentoo sys-kernel/linux-headers: 6.14::gentoo (virtual/os-headers) sys-libs/glibc: 2.41-r1::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git priority: -1000 volatile: False guru location: /var/db/repos/guru sync-type: git sync-uri: https://anongit.gentoo.org/git/repo/sync/guru.git masters: gentoo volatile: False local location: /var/db/repos/local masters: gentoo volatile: False Binary Repositories: gentoobinhost priority: 1 sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64-v3 Installed sets: @base, @extra, @gnomie, @utils ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -flto=auto -fno-semantic-interposition -floop-block -fgraphite-identity -floop-parallelize-all -ftrivial-auto-var-init=zero -Werror=lto-type-mismatch -fdiagnostics-color=always -Werror=strict-aliasing -Werror=format-security" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /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/revdep-rebuild /etc/sandbox.d" CXXFLAGS="-march=native -O2 -pipe -flto=auto -fno-semantic-interposition -floop-block -fgraphite-identity -floop-parallelize-all -ftrivial-auto-var-init=zero -Werror=lto-type-mismatch -fdiagnostics-color=always -Werror=odr -Werror=format-security" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME" FCFLAGS="-march=native -O2 -pipe -flto=auto -fno-semantic-interposition -floop-block -fgraphite-identity -floop-parallelize-all -ftrivial-auto-var-init=zero -Werror=lto-type-mismatch -fdiagnostics-color=always" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks export-pms-vars fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr" FFLAGS="-march=native -O2 -pipe -flto=auto -fno-semantic-interposition -floop-block -fgraphite-identity -floop-parallelize-all -ftrivial-auto-var-init=zero -Werror=lto-type-mismatch -fdiagnostics-color=always" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="C.UTF8" LD="ld.mold" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=auto -fuse-ld=mold -Wl,--color-diagnostics" LEX="flex" LIBTOOL="rlibtool" MAKE="make LIBTOOL=rlibtool" MAKEFLAGS="LIBTOOL=rlibtool" MAKEOPTS="-j10 -l11" 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" RUSTFLAGS="-C target-cpu=native -C linker=clang -C linker-plugin-lto -C link-arg=-flto=auto -C link-arg=-fuse-ld=mold" SHELL="/bin/bash" USE="acl amd64 aom av1 avif bluetooth bzip2 cet crypt cups dbus dist-kernel ffmpeg flac fontconfig gdbm gif gles gles2 gnome gnome-keyring gstreamer gtk gtk4 hardened harfbuzz iconv icu io-uring ipv6 jpeg jpegxl keyring lcms libaom libtirpc lto lz4 lzma lzo modemmanager ncurses networkmanager nls openh264 openmp opus orc pam pcre pdf pgo pic pie pipewire png policykit profile readline screencast seccomp sound spell ssl ssp svg systemd test-rust tiff tpm udev udisks unicode upower usb vaapi vala vpx vulkan wayland webp xattr xml xtpax zlib zstd" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 sha sse sse2 sse3 sse4_1 sse4_2 ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_SLOT="19" LLVM_TARGETS="x86 AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_13" PYTHON_TARGETS="python3_13" RUBY_TARGETS="ruby32" VIDEO_CARDS="intel lavapipe" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LINGUAS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= sys-devel/mold-2.39.0::gentoo was built with the following: USE="-debug -test" Reproducible on both 2.38 and 2.39
Please try to get a backtrace (either by running the failing gcc command under gdb, or by looking at coredumpctl).
(In reply to Sam James from comment #1) > Please try to get a backtrace (either by running the failing gcc command > under gdb, or by looking at coredumpctl). The coredumps aren't captured by coredumpctl I'll try and see if manually running the commands in build dir can get me a backtrace (if I remember to do that correctly)
Similar bug https://github.com/rui314/mold/issues/1449
Can't reproduce when doing it on my own here what I did: chmod -R 755 /var/tmp/portage cp -r /var/tmp/portage/llvm-core/clang-21.0.0_pre20250503/ . cd clang-21.0.0_pre20250503/work/x/y/clang-abi_x86_64.amd64/ Then finally run the commands: mold didn't crash : && /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -flto=auto -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pedantic -Wno-long-long -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=auto -fuse-ld=mold -Wl,--color-diagnostics -Wl,--gc-sections tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/AddUsing.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/AnnotateHighlightings.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DumpAST.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DefineInline.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DefineOutline.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExpandDeducedType.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExpandMacro.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExtractFunction.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExtractVariable.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/MemberwiseConstructor.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ObjCLocalizeStringLiteral.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ObjCMemberwiseInitializer.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/PopulateSwitch.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RawStringLiteral.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RemoveUsingNamespace.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ScopifyEnum.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SpecialMembers.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapBinaryOperands.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdToolMain.cpp.o -o bin/clangd -L/usr/lib/llvm/21/lib64 -Wl,-rpath,"\$ORIGIN/../lib64:/var/tmp/portage/llvm-core/clang-21.0.0_pre20250503/work/x/y/clang-abi_x86_64.amd64/lib64:/usr/lib/llvm/21/lib64:" lib64/libclangdMain.a lib64/libclangDaemon.a lib64/libclangdSupport.a lib64/libclangTidyAndroidModule.a lib64/libclangTidyAbseilModule.a lib64/libclangTidyAlteraModule.a lib64/libclangTidyBoostModule.a lib64/libclangTidyCERTModule.a lib64/libclangTidyConcurrencyModule.a lib64/libclangTidyDarwinModule.a lib64/libclangTidyFuchsiaModule.a lib64/libclangTidyHICPPModule.a lib64/libclangTidyCppCoreGuidelinesModule.a lib64/libclangTidyBugproneModule.a lib64/libclangTidyGoogleModule.a lib64/libclangTidyLinuxKernelModule.a lib64/libclangTidyLLVMModule.a lib64/libclangTidyLLVMLibcModule.a lib64/libclangTidyMiscModule.a lib64/libclangIncludeCleaner.a lib64/libclangTidyModernizeModule.a lib64/libclangTidyObjCModule.a lib64/libclangTidyOpenMPModule.a lib64/libclangTidyPerformanceModule.a lib64/libclangTidyPortabilityModule.a lib64/libclangTidyReadabilityModule.a lib64/libclangTidyZirconModule.a lib64/libclangTidyMPIModule.a lib64/libclangTidyUtils.a lib64/libclangTidy.a lib64/libclangdRemoteIndex.a lib64/libclang-cpp.so.21.0gitd1e38eab /usr/lib/llvm/21/lib64/libLLVM.so.21.0gitd1e38eab && :
(In reply to zyxhere from comment #4) > Can't reproduce when doing it on my own here what I did: Just cd into the build directory and run it as root. > > > : && /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -flto=auto -fPIC > -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time > -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual > -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull > -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move > -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment > -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color > -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual > -fno-strict-aliasing -pedantic -Wno-long-long -Wl,-O1 -Wl,--as-needed > -Wl,-z,pack-relative-relocs -flto=auto -fuse-ld=mold -Wl,--color-diagnostics > -Wl,--gc-sections > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > AddUsing.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > AnnotateHighlightings.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > DumpAST.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > DefineInline.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > DefineOutline.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ExpandDeducedType.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ExpandMacro.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ExtractFunction.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ExtractVariable.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > MemberwiseConstructor.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ObjCLocalizeStringLiteral.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ObjCMemberwiseInitializer.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > PopulateSwitch.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > RawStringLiteral.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > RemoveUsingNamespace.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > ScopifyEnum.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > SpecialMembers.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > SwapBinaryOperands.cpp.o > tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ > SwapIfBranches.cpp.o > tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdToolMain.cpp.o -o > bin/clangd -L/usr/lib/llvm/21/lib64 > -Wl,-rpath,"\$ORIGIN/../lib64:/var/tmp/portage/llvm-core/clang-21.0. > 0_pre20250503/work/x/y/clang-abi_x86_64.amd64/lib64:/usr/lib/llvm/21/lib64:" > lib64/libclangdMain.a lib64/libclangDaemon.a lib64/libclangdSupport.a > lib64/libclangTidyAndroidModule.a lib64/libclangTidyAbseilModule.a > lib64/libclangTidyAlteraModule.a lib64/libclangTidyBoostModule.a > lib64/libclangTidyCERTModule.a lib64/libclangTidyConcurrencyModule.a > lib64/libclangTidyDarwinModule.a lib64/libclangTidyFuchsiaModule.a > lib64/libclangTidyHICPPModule.a lib64/libclangTidyCppCoreGuidelinesModule.a > lib64/libclangTidyBugproneModule.a lib64/libclangTidyGoogleModule.a > lib64/libclangTidyLinuxKernelModule.a lib64/libclangTidyLLVMModule.a > lib64/libclangTidyLLVMLibcModule.a lib64/libclangTidyMiscModule.a > lib64/libclangIncludeCleaner.a lib64/libclangTidyModernizeModule.a > lib64/libclangTidyObjCModule.a lib64/libclangTidyOpenMPModule.a > lib64/libclangTidyPerformanceModule.a lib64/libclangTidyPortabilityModule.a > lib64/libclangTidyReadabilityModule.a lib64/libclangTidyZirconModule.a > lib64/libclangTidyMPIModule.a lib64/libclangTidyUtils.a > lib64/libclangTidy.a lib64/libclangdRemoteIndex.a > lib64/libclang-cpp.so.21.0gitd1e38eab > /usr/lib/llvm/21/lib64/libLLVM.so.21.0gitd1e38eab && : Weird. Try prefixing it with sandbox.
Created attachment 927788 [details] clang 9.1.7 mold failure einfo+log Tried a build with mold, and get similar results.
(In reply to Sam James from comment #5) > (In reply to zyxhere from comment #4) > > Can't reproduce when doing it on my own here what I did: > > Just cd into the build directory and run it as root. No luck > Weird. Try prefixing it with sandbox. How do you do that exactly?
(In reply to Sven B. from comment #6) > Created attachment 927788 [details] > clang 9.1.7 mold failure einfo+log > > Tried a build with mold, and get similar results. Oh interesting my clang-19 and <clang-21.0.0_pre20250503 builds fine I'll try rebuilding 19 again just in case
(In reply to zyxhere from comment #8) > (In reply to Sven B. from comment #6) > > Created attachment 927788 [details] > > clang 9.1.7 mold failure einfo+log > > > > Tried a build with mold, and get similar results. > > Oh interesting my clang-19 and <clang-21.0.0_pre20250503 builds fine > > I'll try rebuilding 19 again just in case 19 builds fine
The crash is reproducible building clang 19.1.7 and 20.1.4 for me. Please bump mold version to 2.39.1 (as described, fixed a potential use-after-free issue that occurred when doing LTO with LLVM) and see if the crash still exists.
(In reply to Blacktea Hamburger from comment #10) > The crash is reproducible building clang 19.1.7 and 20.1.4 for me. > > Please bump mold version to 2.39.1 (as described, fixed a potential > use-after-free issue that occurred when doing LTO with LLVM) and see if the > crash still exists. I will shortly (have other stuff to do) tho I will note that these faults were with gcc