Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933496 - sys-devel/clang-18: ICE when building net-im/telegram-desktop-5.0.4
Summary: sys-devel/clang-18: ICE when building net-im/telegram-desktop-5.0.4
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-03 21:04 UTC by cmvu
Modified: 2024-06-03 22:16 UTC (History)
2 users (show)

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


Attachments
Compilation with O3 (buildlog-telegram-riceflags.log,755.87 KB, text/plain)
2024-06-03 21:05 UTC, cmvu
Details
Compilation with normal flags (buildlog-telegram-saneflags.log,653.37 KB, text/plain)
2024-06-03 21:06 UTC, cmvu
Details
base_url_scheme_linux.sh (base_url_scheme_linux-9c6ef7.sh.xz,2.26 KB, application/x-xz)
2024-06-03 21:36 UTC, cmvu
Details
base_power_save_blocker_linux-1f9c4f.sh (base_power_save_blocker_linux-1f9c4f.sh.xz,2.27 KB, application/x-xz)
2024-06-03 21:38 UTC, cmvu
Details
base_last_input_linux-0bc6ee.sh (base_last_input_linux-0bc6ee.sh.xz,2.26 KB, application/x-xz)
2024-06-03 21:38 UTC, cmvu
Details
Tar archive with cpp files mentioned in build log. Part 1 (tg-933496.tar.zst00,976.56 KB, application/zstd)
2024-06-03 22:13 UTC, cmvu
Details
Tar archive with cpp files mentioned in build log. Part 2 (tg-933496.tar.zst01,241.11 KB, application/octet-stream)
2024-06-03 22:14 UTC, cmvu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cmvu 2024-06-03 21:04:03 UTC
When compiling with clang++ compiler crashes with "clang++: error: clang frontend command failed with exit code 135" when trying to build some of the files.

Used on profile
Tried on clang-17 clang-18 with 
-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE_EXTENSIVE -march=native -pipe -O3 -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -flto=thin -Wl,-O2 -Wl,--as-needed -Wl,-z,relro -Wl,-z,now

AND with minimal flags
-O2 -pipe
With the same error

I`ve noticed that problem seems to be occurring in code that is connected to GIR and GIO so as a test I`ve removed tdesktop-4.10.0-system-cppgir.patch from ebuild and after that compilation succeeded.

Reproducible: Always

Steps to Reproduce:
1. Try to compile telegram
Actual Results:  
Compiler crashed

Expected Results:  
Telegram compiled

Portage 3.0.64 (python 3.11.9-final-0, default/linux/amd64/23.0/llvm/systemd, gcc-14, glibc-2.39-r6, 6.9.2-ds6m-clang x86_64)
=================================================================
System uname: Linux-6.9.2-ds6m-clang-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.39
KiB Mem:    65764540 total,  55172072 free
KiB Swap:   67108860 total,  67108860 free
Head commit of repository gentoo: 1b8485fb2bdb2ba80218b0a3206bfc629d4db5b5

Timestamp of repository mv: Sat, 25 May 2024 18:33:33 +0000
Head commit of repository mv: 2bc9ea74e54c1f99d72287c7dbb93a11ebf98e9b

Timestamp of repository pf4public: Sat, 01 Jun 2024 21:18:44 +0000
Head commit of repository pf4public: 9098c291f7f77ff738b4b966d37a8175c28137ae

Timestamp of repository steam-overlay: Mon, 20 May 2024 17:23:25 +0000
Head commit of repository steam-overlay: 3aa8d3201d7bce32a1a0fffdf4afd9dbd0583048

sh bash 5.2_p26-r3
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r3::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 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.0-r1::gentoo
dev-lang/perl:             5.38.2-r5::gentoo
dev-lang/python:           3.11.9-r1::gentoo, 3.12.3-r1::gentoo, 3.13.0_beta1_p3::gentoo
dev-lang/rust:             1.77.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.6::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo, 18.1.6::gentoo
sys-devel/gcc:             14.1.1_p20240518::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo, 18.1.6::gentoo
sys-devel/llvm:            17.0.6::gentoo, 18.1.6::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
location: /var/db/repos/gentoo
sync-type: git
sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git
priority: -1000
volatile: False

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

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

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

ds6-local
location: /var/db/repos/localrepo
masters: gentoo
priority: 10
volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -pipe -O3 -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -flto=thin "
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/revdep-rebuild /etc/sandbox.d"
CPP="clang-cpp"
CPPFLAGS="-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE_EXTENSIVE "
CXX="clang++"
CXXFLAGS="-march=native -pipe -O3 -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -flto=thin "
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="-a --jobs=100"
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 -pipe -O3 -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -flto=thin "
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LD="ld.lld"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,-z,relro -Wl,-z,now"
LEX="flex"
MAKEOPTS="-j32"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
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"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="X acl amd64 audit bzip2 cairo caps cet clang crypt dbus egl fapi flac gdbm gles gles2 gstreamer hardened ibus iconv icu idn introspection ipv6 jpeg kde kf6compat libtirpc llvm-libunwind lto lzma lzo mp3 mp4 multilib ncurses networkmanager nls ogg opengl openh264 openmp pam pcre phonon pic pipewire plasma png policykit pulseaudio qml qt6 readline screencast seccomp share ssl svg systemd test-rust threads tpm udev unicode vaapi vdpau verify-sig vorbis vulkan wayland x264 x265 xattr xwayland zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" ALSA_CARDS="hda-intel usb-audio" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US ru" LLVM_SLOT="18" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="aarch64 x86_64" QEMU_USER_TARGETS="aarch64 x86_64" VIDEO_CARDS="nvidia"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RUSTFLAGS, SIZE, YACC, YFLAGS
Comment 1 cmvu 2024-06-03 21:05:50 UTC
Created attachment 895016 [details]
Compilation with O3
Comment 2 cmvu 2024-06-03 21:06:48 UTC
Created attachment 895017 [details]
Compilation with normal flags
Comment 3 Alfred Wingate 2024-06-03 21:12:25 UTC
Could you include these? (from the minimal flag build preferably)


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /var/tmp/portage/net-im/telegram-desktop-5.0.4/temp/base_url_scheme_linux-0df093.cpp
clang++: note: diagnostic msg: /var/tmp/portage/net-im/telegram-desktop-5.0.4/temp/base_url_scheme_linux-0df093.sh
clang++: note: diagnostic msg: 

And this occurs with clang-17 as well?
Comment 4 cmvu 2024-06-03 21:36:44 UTC
Created attachment 895019 [details]
base_url_scheme_linux.sh
Comment 5 cmvu 2024-06-03 21:38:01 UTC
Created attachment 895020 [details]
base_power_save_blocker_linux-1f9c4f.sh
Comment 6 cmvu 2024-06-03 21:38:33 UTC
Created attachment 895021 [details]
base_last_input_linux-0bc6ee.sh
Comment 7 cmvu 2024-06-03 21:40:13 UTC
I`ve attached sh files that are mentioned in build log. Unfortunately I cant attach cpp file because even compressed they are still over file size limit. Maybe there is a way to still post it here (for exmaple pastebin)
Comment 8 cmvu 2024-06-03 21:41:23 UTC
Yes problem occurs on clang-17 and clang-18 in both flag configurations (o3 and O2)
Comment 9 Alfred Wingate 2024-06-03 21:47:18 UTC
I'll try to replicate on my llvm machine. Will see if I'm able to minimise the reproducer.

Something in system cppgir and how it interacts with telegram is tripping it.
Comment 10 cmvu 2024-06-03 21:49:18 UTC
This problem also occurs on latest telegram version - 5.1.1
Comment 11 cmvu 2024-06-03 21:51:26 UTC
System installed cppgir version is dev-cpp/cppgir-2.0_p20240315
Just as test i`ll try to downgrade it
Comment 12 cmvu 2024-06-03 22:13:54 UTC
Created attachment 895022 [details]
Tar archive with cpp files mentioned in build log. Part 1
Comment 13 cmvu 2024-06-03 22:14:17 UTC
Created attachment 895023 [details]
Tar archive with cpp files mentioned in build log. Part 2
Comment 14 cmvu 2024-06-03 22:16:39 UTC
Squeezed cpp files in.
Its a zstd compressed tar archive. Use
cat tg-933496.tar.zst00 tg-933496.tar.zst01 | tar --zstd --extract --file -
to decompress