Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 448530 - sys-devel/clang segfaults with USE="debug"
Summary: sys-devel/clang segfaults with USE="debug"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-25 14:31 UTC by Julian Ospald
Modified: 2013-01-03 23:36 UTC (History)
2 users (show)

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


Attachments
pnmixer-0.6_pre20111213:20121225-030832.log (pnmixer-0.6_pre20111213:20121225-030832.log,3.99 KB, text/plain)
2012-12-25 14:31 UTC, Julian Ospald
Details
config.log (config.log,12.35 KB, text/plain)
2012-12-25 14:33 UTC, Julian Ospald
Details
conftest-I0XZjZ.c (conftest-I0XZjZ.c,337 bytes, text/plain)
2012-12-25 14:34 UTC, Julian Ospald
Details
conftest-I0XZjZ.sh (conftest-I0XZjZ.sh,392 bytes, text/plain)
2012-12-25 14:35 UTC, Julian Ospald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2012-12-25 14:31:49 UTC
Created attachment 333282 [details]
pnmixer-0.6_pre20111213:20121225-030832.log

no matter where I test it, it seems unable to even compile a simple test program. dmesg shows the segfault

# emerge --info
Portage 2.2.0_alpha149 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.15-r3, 3.4.9-gnu-ck3 x86_64)
=================================================================
System uname: Linux-3.4.9-gnu-ck3-x86_64-Intel-R-_Core-TM-2_CPU_6400_@_2.13GHz-with-gentoo-2.1
Timestamp of tree: Mon, 24 Dec 2012 13:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.8 [enabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.5.4-r4, 2.6.8, 2.7.3-r2, 3.1.5, 3.2.3
dev-util/ccache:          3.1.8
dev-util/cmake:           2.8.10.2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.1, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.7, 4.5.4, 4.6.3, 4.7.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo crossdev hasufell-overlay gentoo-zh neurogeek sunrise hasufell arx-libertatis
Installed sets: @optional, @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -Wall -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/applications /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-march=core2 -O2 -pipe -Wall -ggdb"
DISTDIR="/home/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://de-mirror.org/gentoo/ ftp://mirror.netcologne.de/gentoo/ ftp://gentoo.imj.fr/pub/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j2"
PKGDIR="/home/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/crossdev /usr/local/portage /var/lib/layman/gentoo-zh /var/lib/layman/neurogeek /var/lib/layman/sunrise /var/lib/layman/hasufell /var/lib/layman/arx-libertatis"
SYNC="rsync://rsync1.de.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apng bash-completion berkdb bzip2 cairo cdr cli consolekit cracklib crypt cscope css cxx dbus dri dv dvd dvdr exif fat ffmpeg flac fontconfig fortran gdbm gif gpm gstreamer hddtemp iconv icq ipv6 jabber java jpeg jpeg2k lame libnotify lm_sensors matroska mmx modules mp3 mp4 mpeg mudflap multilib musepack ncurses nls nptl nsplugin ntfs ogg opengl openmp oscar pam pcre pdf png policykit pppd python raw readline sdl session sound sse sse2 ssl ssse3 svg tcpd tiff timidity truetype udev unicode usb v4l vcd vdpau vim-syntax vnc vorbis wavpack wmf x264 xv xvid xvmc zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer wiki-publisher" LINGUAS="de en" NETBEANS_MODULES="*" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="*" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" 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"
USE_PYTHON="2.5 2.6 2.7 3.1 3.2"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Julian Ospald 2012-12-25 14:33:53 UTC
Created attachment 333284 [details]
config.log
Comment 2 Julian Ospald 2012-12-25 14:34:47 UTC
Created attachment 333286 [details]
conftest-I0XZjZ.c
Comment 3 Julian Ospald 2012-12-25 14:35:06 UTC
Created attachment 333288 [details]
conftest-I0XZjZ.sh
Comment 4 Julian Ospald 2012-12-25 14:35:35 UTC
clang env settings:

FEATURES="-ccache -buildpkg -distcc -splitdebug"
CC=clang
CXX=clang++
CFLAGS="-march=core2 -O4 -g"
CXXFLAGS="${CFLAGS}"
Comment 5 Julian Ospald 2012-12-26 02:26:50 UTC
# clang --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

# /usr/bin/llvm-ar --version
LLVM (http://llvm.org/):
  LLVM version 3.2svn
  Optimized build.
  Built Dec 24 2012 (15:29:49).
  Default target: x86_64-pc-linux-gnu
  Host CPU: core2
Comment 6 Julian Ospald 2012-12-26 02:54:49 UTC
I smell that this is related to FEATURES="splitdebug"

will test tomorrow
Comment 7 Julian Ospald 2012-12-26 16:23:07 UTC
tried with splitdebug/nostrip, without any of them, without "debug" useflag, no change
Comment 8 Julian Ospald 2012-12-26 18:02:12 UTC
have to correct myself... this seems related to USE=debug

compiling simple test program fails. It does succeed when clang is compiled without debug useflag:

# cat test.c
int main () { return 0; }

# clang test.c -o test
0  libLLVM-3.2svn.so 0x00007f8df14f4fdf
1  libLLVM-3.2svn.so 0x00007f8df14f5579
2  libpthread.so.0   0x000000378fa0f500
3  clang             0x0000000000609efa std::string::assign(std::string const&) + 234
4  clang             0x000000000080dc5f
5  clang             0x000000000080c288
6  clang             0x0000000000a38bb9 clang::Sema::Initialize() + 25
7  clang             0x00000000009a13b7 clang::Parser::Initialize() + 1063
8  clang             0x000000000099ea88 clang::ParseAST(clang::Sema&, bool, bool) + 152
9  clang             0x000000000080ae5e clang::CodeGenAction::ExecuteAction() + 78
10 clang             0x0000000000667a19 clang::FrontendAction::Execute() + 185
11 clang             0x000000000063f438 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 344
12 clang             0x0000000000618af4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1988
13 clang             0x0000000000609168 cc1_main(char const**, char const**, char const*, void*) + 1160
14 clang             0x0000000000612ee2 main + 7186
15 libc.so.6         0x000000378f21f28d __libc_start_main + 253
16 clang             0x00000000006089f9
Stack dump:
0.	Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -resource-dir /usr/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.2/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/jule/tmp/clang -ferror-limit 19 -fmessage-length 119 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-gv7Qks.o -x c test.c 
1.	<eof> parser at end of file
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-D6Hf9L.c
clang: note: diagnostic msg: /tmp/test-D6Hf9L.sh
clang: note: diagnostic msg: 

********************
Comment 9 Julian Ospald 2012-12-26 18:23:19 UTC
this seems to be caused by a mismatch of "debug" useflag between clang and llvm

when both have -debug it works, when both have +debug it works
when clang has +debug and llvm -debug it does not work
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-26 23:42:11 UTC
(In reply to comment #9)
> this seems to be caused by a mismatch of "debug" useflag between clang and
> llvm
> 
> when both have -debug it works, when both have +debug it works
> when clang has +debug and llvm -debug it does not work

The opposite seems to fail as well. Therefore, the dep should be [debug=].
Comment 11 Bernard Cafarelli gentoo-dev 2013-01-03 23:36:42 UTC
From some older problems we already had with llvm/clang, this does not surprise me. Thanks for hunting that one down, I updated the depend on llvm with "debug=" in all current clang ebuilds