Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934655 - dev-qt/qtdeclarative:6 causes segfault in kcmutils, plasmashell, and systemsettings when compiled with -ffuction-sections -Wl,--icf=all using Clang/LLVM profile
Summary: dev-qt/qtdeclarative:6 causes segfault in kcmutils, plasmashell, and systemse...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-21 12:39 UTC by unhappy-ending
Modified: 2024-06-21 12:59 UTC (History)
2 users (show)

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


Attachments
qtdeclarative icf=all/icf=safe and kcmutils pass/fail logs (build-logs.tar.gz,376.58 KB, application/gzip)
2024-06-21 12:42 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2024-06-21 12:39:08 UTC
See title. If you have both flags enabled qtdeclarative will cause runtime issues for packages that rely on it. Both flags by themselves seem ok, it's when they're combined that it becomes an issue. However, if you compile with -ffunction-sections -Wl,--icf=safe then it's fine.

Rather than filter out -ffuction-sections, -Wl,--icf=all, or both one could use replace-flags -Wl,--icf=all -Wl,--icf=safe which is what I'm currently doing.

Attaching logs with build flags to show an example. kde-frameworks/kcmutils will segfault during the testing phase so that's the only way I can prove that this is happening.

Reproducible: Always

Steps to Reproduce:
1. CFLAGS="${CFLAGS} -ffunction-sections" LDFLAGS="${LDFLAGS} -Wl,--icf=all"
2. compile dev-qt/qtdeclarative-6.7.2
3. ALLOW_TEST=all FEATURES=test ebuild kde-frameworks/kcmtuls-6.3.0.ebuild clean test
Actual Results:  
4/4 Test #3: kcmloadtest ......................***Exception: SegFault  0.18 sec

Expected Results:  
100% tests passed

Possibly more segfaults but that's all I was able to find since I had a busted plasmashell with libQt6Qml.so segfault complaints in dmesg output. kcmutils I noticed failed its test phase with a segfault after the qt-6.7.2 upgrade.
Comment 1 unhappy-ending 2024-06-21 12:42:47 UTC
Created attachment 896217 [details]
qtdeclarative icf=all/icf=safe and kcmutils pass/fail logs

Here are the logs. You can see the *FLAGS in use for each of them.
Comment 2 unhappy-ending 2024-06-21 12:51:38 UTC
I forgot, I did compile all of qt-6.7.1 and the same thing happened. I haven't tested qt:5 nor have I tested gcc with -fuse-ld=lld to see if the same combination fails with it.

Anyway, here's emerge --info qtdeclarative
Portage 3.0.65 (python 3.12.4-final-0, default/linux/amd64/23.0/llvm/systemd, gcc-13, glibc-2.39-r9, 6.9.5-clangx86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-6.9.5-clang-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.39
KiB Mem:    32818888 total,  12433156 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 21 Jun 2024 09:49:04 +0000
Head commit of repository gentoo: 64f04748b0afc1f5165eb20a4db83239850fc1dc

Head commit of repository audio-overlay: 20bf7b1970d2e2e20ed33f6b9563a659190ae368

Head commit of repository brave-overlay: d625d99a411919fc02d4ed91cd5e15f17b95dfd5

Head commit of repository cg: ba8674c2b86cca2964c53c34db7c44c1a66cb528

Head commit of repository guru: b8d29619de43a844d6b94f313cbf1c94fd01c6f8

Head commit of repository src_prepare-overlay: ef2df54710e060867bbef5f4e105b906623866f3

Head commit of repository steam-overlay: fc142da83eb4eb440c787e9f1befe5945b09f485

sh bash 5.2_p26-r4
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r4::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.4_p1::gentoo
dev-lang/rust-bin:         1.78.0::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.7::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           18.1.7::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo, 14.1.1_p20240615::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.7::gentoo
sys-devel/llvm:            18.1.7::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r9::gentoo
Repositories:

gentoo
location: /etc/portage/repos/gentoo
sync-type: git
sync-uri: https://github.com/gentoo-mirror/gentoo.git
priority: 0
eclass-overrides: unhappy-ending
volatile: True

audio-overlay
location: /etc/portage/repos/audio-overlay
sync-type: git
sync-uri: https://github.com/gentoo-audio/audio-overlay.git
masters: gentoo
priority: 50
eclass-overrides: audio-overlay
volatile: True

brave-overlay
location: /etc/portage/repos/brave-overlay
sync-type: git
sync-uri: https://gitlab.com/jason.oliveira/brave-overlay.git
masters: gentoo
priority: 50
eclass-overrides: brave-overlay
volatile: True

cg
location: /etc/portage/repos/cg
sync-type: git
sync-uri: https://github.com/brothermechanic/cg
masters: gentoo
priority: 50
eclass-overrides: cg
volatile: True

guru
location: /etc/portage/repos/guru
sync-type: git
sync-uri: https://anongit.gentoo.org/git/repo/proj/guru
masters: gentoo
priority: 50
eclass-overrides: guru
volatile: True

src_prepare-overlay
location: /etc/portage/repos/src_prepare-overlay
sync-type: git
sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
masters: gentoo
priority: 50
eclass-overrides: src_prepare-overlay
volatile: True

steam-overlay
location: /etc/portage/repos/steam-overlay
sync-type: git
sync-uri: https://github.com/anyc/steam-overlay
masters: gentoo
priority: 50
eclass-overrides: steam-overlay
volatile: True

unhappy-ending
location: /etc/portage/repos/unhappy-ending
masters: gentoo
priority: 100
eclass-overrides: unhappy-ending
volatile: True

Binary Repositories:

gentoobinhost
priority: 1
sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64_llvm

Installed sets: @desktop-apps, @desktop-emulation, @dev-qt, @kde-apps, @kde-frameworks, @kde-misc, @kde-plasma, @production-audio, @steam-client, @system-hardware, @system-kernel, @system-tools, @toolchain-llvm
ACCEPT_KEYWORDS="amd64 ~* ~amd64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="llvm-as"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=znver2 -O3 -pipe -ffunction-sections -fdiagnostics-color=always -frecord-gcc-switches -Werror=format-security -Werror=implicit-function-declaration -Werror=incompatible-library-redeclaration -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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-php8.3/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CPP="clang-cpp"
CXX="clang++"
CXXFILT="llvm-cxxfilt"
CXXFLAGS="-march=znver2 -O3 -pipe -ffunction-sections -fdiagnostics-color=always -frecord-gcc-switches -Werror=format-security -Werror=odr -Werror=strict-aliasing"
DISTDIR="/etc/portage/package.distfiles"
EMERGE_DEFAULT_OPTS="-a -j16 -l12 --alphabetical --autounmask=n --columns --quiet-build --quiet-unmerge-warn --with-bdeps=y"
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=znver2 -O3 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fail-clean 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 sfperms split-log strict test unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver2 -O3 -pipe"
GCOV="llvm-cov"
GENTOO_MIRRORS="http://distfiles.gentoo.org /etc/portage/package.mirrors"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--icf=all -Wl,--defsym=__gentoo_check_ldflags__=0"
LEX="flex"
LINGUAS="*"
MAKEOPTS="-j16 -l12"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/etc/portage/package.distfiles/bin"
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="/etc/portage/package.tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
SHELL="/bin/bash"
SIZE="llvm-size"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="acl aes amd64 avx avx2 bzip2 cet clang crypt f16c fma3 gdbm iconv ipv6 libtirpc llvm-libunwind mmx mmxext multilib ncurses nls openmp pam pclmul pcre popcnt rdrand readline seccomp sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssse3 systemd test test-rust udev unicode xattr zlib" ABI_X86="64" ADA_TARGET="gcc_12" CALLIGRA_FEATURES="karbon sheets words" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="*" LLVM_SLOT="18" LLVM_TARGETS="BPF NVPTX X86" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-1" PERL_FEATURES="ithreads" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" QEMU_SOFTMMU_TARGETS="aarch64 arm x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby32" VIDEO_CARDS="nvidia virgl"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GPROF, INSTALL_MASK, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, YACC, YFLAGS

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

dev-qt/qtdeclarative-6.7.2::gentoo was built with the following:
USE="-accessibility jit network opengl -qmlls sql ssl -svg vulkan widgets" ABI_X86="(64)"
CFLAGS="-march=znver2 -O2 -pipe -ffunction-sections -fdiagnostics-color=always -frecord-gcc-switches -Werror=format-security -Werror=implicit-function-declaration -Werror=incompatible-library-redeclaration -Werror=strict-aliasing"
CXXFLAGS="-march=znver2 -O2 -pipe -ffunction-sections -fdiagnostics-color=always -frecord-gcc-switches -Werror=format-security -Werror=odr -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict test unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--icf=safe -Wl,--defsym=__gentoo_check_ldflags__=0"
Comment 3 Ionen Wolkens gentoo-dev 2024-06-21 12:59:17 UTC
Don't think interested in adding workarounds for options that violates the C++ spec as I understand it, this feels like trying to deal with -ffast-math which shouldn't be expected to be safe globally.

You're on your own if you use icf=all.