Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671266 - dev-lang/rust-1.30.1-r1 SIGSEGV with sys-devel/llvm-7.0.0-r1
Summary: dev-lang/rust-1.30.1-r1 SIGSEGV with sys-devel/llvm-7.0.0-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 674068
  Show dependency tree
 
Reported: 2018-11-16 12:20 UTC by Johannes Hirte
Modified: 2019-05-11 09:30 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Hirte 2018-11-16 12:20:59 UTC
When building dev-lang/rust-1.30.1-r1 with system-llvm, the build fails with the following error:

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/build/bootstrap/debug/rustc - --crate-name ___ --print=file-names --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (signal: 11, SIGSEGV: invalid memory reference)
command did not execute successfully: "/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rust-stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "3" "--release" "--locked" "--frozen" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101

dmesg shows me this corresponding entry:

rustc[16695]: segfault at 100000005 ip 00007f706267c482 sp 00007ffef97dc580 error 4 in libLLVMX86CodeGen.so.7[7f706248c000+20e000]

Reproducible: Always




emerge --info

Portage 2.3.51 (python 3.7.0-final-0, default/linux/amd64/17.1, gcc-8.2.0, glibc-2.27-r6, 4.19.1-01580-gde60085298b5 x86_64)
=================================================================
System uname: Linux-4.19.1-01580-gde60085298b5-x86_64-AMD_PRO_A10-8700B_R6,_10_Compute_Cores_4C+6G-with-gentoo-2.6
KiB Mem:    15886764 total,   2789076 free
KiB Swap:    4194304 total,   3541256 free
Head commit of repository gentoo: becff986b7956e3cfc91b0005f5cf7a56eb4ec4d

Head commit of repository kde: 25da4f9afd552319bc36e9d8fe60628e9a8c8fed

Head commit of repository qt: 04c2c9da3497949d94bc55256d15580ca865079b

sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p3) 2.31.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.5 [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/ccache:          3.5-r1::gentoo
dev-util/cmake:           3.12.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r1::gentoo
sys-devel/gcc:            7.3.0-r6::gentoo, 8.1.0-r3::gentoo, 8.2.0-r5::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

kde
    location: /usr/local/portage/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

local
    location: /usr/local/portage/local
    masters: gentoo
    priority: 50

qt
    location: /usr/local/portage/qt
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=bdver4 -msahf -mpopcnt -mlzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=1024 -mtune=bdver4 -ftree-vectorize -fvect-cost-model -pipe"
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.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/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"
CXXFLAGS="-O2 -march=bdver4 -msahf -mpopcnt -mlzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=1024 -mtune=bdver4 -ftree-vectorize -fvect-cost-model -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer multilib-strict news parallel-fetch preserve-libs 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"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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 aacplus acl alsa amd64 amr amrenc anacron berkdb bluetooth bzip2 cairo caps celt chm clang cleartype_hinting cli corefonts crypt cryptsetup cups cxx d3d9 dbus device-mapper djvu dri drm dvd ebook editorconfig efi egl eps epub evdev exif faac ffmpeg fftw flac fontconfig fortran gbm gdbm gif git glamor gmp gold gpg gphoto2 gpm graphviz harfbuzz iconv icu id3tag ipv6 ithreads jemalloc jpeg kipi lcms lensfun libatomic libcxx libcxxabi libffi libinput libkms libsamplerate libtirpc libunwind lm_sensors lz4 lzma lzo mad matroska mjpeg mmap mng mobi modern-top mp3 mpeg mtp multilib mysql ncurses networkmanager nfs nls nptl ogg openal opencv openexr opengl openmp openssl opus pam parted pcre pcre16 pdf png policykit postscript pulseaudio python qt5 raw readline s3tc schroedinger sdl sdl2 seccomp sift smp sndfile sox speex spice sqlite ssl subversion svg system-harfbuzz system-icu system-jpeg system-jsoncpp system-libvpx system-sqlite systemd taglib tcpd tesseract theora threads thumbnail tiff truetype udev unicode urandom usb usbredir user-session v4l vaapi vde vdpau vhosts virgl virt-network virtfs vorbis vpx vte vulkan wavpack wayland webp wmf x264 x265 xattr xcb xcomposite xkb xml xmp xpm xv xvid zlib zstd" ABI_X86="64" 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 plan sheets stage words" CAMERAS="canon ricoh ricoh_g3" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="avx avx2 f16c fma3 fma4 mmx mmxext popcnt sse sse2 sse3 ssse3 sse4_1 sse4_2 xop" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc" INPUT_DEVICES="evdev libinput synaptics" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Johannes Hirte 2018-11-16 22:54:11 UTC
Without system-llvm everything works fine.
Comment 2 Johannes Hirte 2018-11-18 10:07:37 UTC
On amdfam10 and ivybridge it works with system-llvm. Only on my Carrizo it is reproducible.
Comment 3 Johannes Hirte 2018-11-19 14:50:02 UTC
After some investigations, I found that there were some leftovers in /etc/portage/package.env/ that caused to build rust with clang. After removing this and building rust with gcc it works with system-llvm. Not sure if this is really a bug, but mixing gcc and clang builds lead to the segfault. Building both parts, llvm and rust with the same compiler works.
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-19 15:35:42 UTC
Ah, thank you for the further investigation! When I asked about this in upstream forums, I got linked to this issue, so that seems to match your experience:

https://bugs.llvm.org/show_bug.cgi?id=39427
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-19 15:38:33 UTC
LLVM folks, could we roll a patch to fix this on the LLVM side into our 7.x builds? It looks like upstream has reverted it for 8.x+ (see linked issue).
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-11-19 17:14:22 UTC
(In reply to Dirkjan Ochtman from comment #5)
> LLVM folks, could we roll a patch to fix this on the LLVM side into our 7.x
> builds? It looks like upstream has reverted it for 8.x+ (see linked issue).

FWICS, it's planned for inclusion in 7.0.1 and that should go out soonish, so I'm not sure if this is really worth another 7.0.0 rebuild.
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-20 20:11:43 UTC
Sounds good, let's wait for 7.0.1.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-21 21:45:39 UTC
Could you please confirm that llvm-7.0.1 solves the issue, and close the bug if it does?
Comment 9 Arfrever Frehtes Taifersar Arahesis 2018-12-22 08:50:31 UTC
According to "ABI change in LLVM 7.0.x release" thread (starting in https://lists.llvm.org/pipermail/llvm-dev/2018-December/128246.html) on llvm-dev mailing list, the fix is scheduled to be included in the upcoming 7.1.0 release, and is not in 7.0.1.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-05-11 09:30:08 UTC
Should be fixed in 7.1.0.