Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504760 - net-fs/samba: test for -errwarn=%all flag sometimes triggers crashes when building w/gcc since the flag gets pass through to the linker
Summary: net-fs/samba: test for -errwarn=%all flag sometimes triggers crashes when bui...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
Depends on:
Reported: 2014-03-16 07:15 UTC by Sergey S. Starikoff
Modified: 2015-10-24 16:42 UTC (History)
2 users (show)

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

SIGSEGV confest core dump (core_conftest-11.22302,272.00 KB, application/x-coredump)
2014-03-16 07:15 UTC, Sergey S. Starikoff
SIGABRT samba conftest core dump (core_conftest-6.26403,832.00 KB, application/x-coredump)
2014-03-16 07:15 UTC, Sergey S. Starikoff
conftest.c (conftest.c,1.13 KB, text/x-csrc)
2015-09-16 08:31 UTC, Sergey S. Starikoff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey S. Starikoff 2014-03-16 07:15:19 UTC
Created attachment 372790 [details]
SIGSEGV confest core dump

After enableing core dumps for debug purposes I've find some core dumps after successful system update.
Now (just today) I can name one such package (net-fs/samba-3.6.23), but according to usual number of core-dump files I expect at least 3 or 4.
These core dumps doesn't provide any fatal errors.

Вс 16 мар 2014 10:33:54   >>> emerge (2 of 3) net-fs/samba-3.6.23 to /
Вс 16 мар 2014 10:33:54   === (2 of 3) Cleaning (net-fs/samba-3.6.23
Вс 16 мар 2014 10:33:55   === (2 of 3) Compiling/Merging (net-fs/samba-3.6.23
Вс 16 мар 2014 10:37:06   === (2 of 3) Merging (net-fs/samba-3.6.23
Вс 16 мар 2014 10:37:09   >>> AUTOCLEAN
Вс 16 мар 2014 10:37:09   === Unmerging... (net-fs/samba-3.6.22)
Вс 16 мар 2014 10:37:11   >>> unmerge success
Вс 16 мар 2014 10:37:14   === (2 of 3) Post-Build Cleaning (net-fs/samba-3.6.23
Вс 16 мар 2014 10:37:14   

ls -l cores/
-rw------- 1 portage portage    278528 мар 16 10:34 core_conftest-11.22302
-rw------- 1 portage portage    851968 мар 16 10:34 core_conftest-6.26403

My system:
$ einfo 
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.10.25-aufs x86_64)
System uname: Linux-3.10.25-aufs-x86_64-Intel-R-_Core-TM-_i5_CPU_661_@_3.33GHz-with-gentoo-2.2
KiB Mem:     7978036 total,   3394632 free
KiB Swap:    4024240 total,   4024240 free
Timestamp of tree: Sun, 16 Mar 2014 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo rion zugaina local_home
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /etc/conf.d/clock /etc/rc.conf /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/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="-march=native -O2 -pipe"
EMERGE_DEFAULT_OPTS="--ask=y --verbose --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
PORTDIR_OVERLAY="/usr/portage/layman/rion /usr/portage/layman/zugaina /usr/portage/local"
USE="X a52 acl alsa amd64 berkdb bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus djvu dri dv dvd ffmpeg flac fortran gdbm gif gtk iconv icu jpeg jpeg2k kpathsea mac mmx modules mp3 mpeg multilib ncurses nls nptl ogg openmp pam pcre pdf png policykit qt3support readline session sse sse2 ssl tcpd tiff truetype unicode utf8 v4l v4l2 vorbis zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FOO2ZJS_DEVICES="hp1018" 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 ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="intel" 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"
Comment 1 Sergey S. Starikoff 2014-03-16 07:15:59 UTC
Created attachment 372792 [details]
SIGABRT samba conftest core dump
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-17 14:22:39 UTC
Comment on attachment 372790 [details]
SIGSEGV confest core dump

Please attach gdb backtraces, not coredump files.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-17 14:22:51 UTC
Comment on attachment 372792 [details]
SIGABRT samba conftest core dump

Comment 4 Alex Xu (Hello71) 2014-03-19 21:22:16 UTC
Please attach gdb backtraces ("bt full").

Core dumps are useless without the binary and all libraries and all symbols.
Comment 5 Sergey S. Starikoff 2014-03-20 10:45:20 UTC
(In reply to Alex Xu (Hello71) from comment #4)
> Please attach gdb backtraces ("bt full").
It would be nice, but I can't guess how to get them: which binary burns this process, and how much times it's called?

Could you reproduce my check?

1. Enable writing core dump files.
2. Not to search for them set up core name:
kernel.core_pattern = /tmp/cores/core_%e-%s.%p
(also providing process name, kill sinal and pid number in core filename)
3. local.d script to create temporary directory for cores:
mkdir -m 0777 /tmp/cores

And check the known issued procedure
# ebuild samba-3.6.23.ebuild configure
 for first SIGSEGV core dump
Comment 6 Sergey S. Starikoff 2015-09-15 14:20:58 UTC
Today's update showed issue present for =gnome-base/dconf-0.24.0
Comment 7 Sergey S. Starikoff 2015-09-16 08:31:30 UTC
Created attachment 412020 [details]

Issue still present for =net-fs/samba-3.6.25 built with =sys-devel/gcc-4.8.5.

Attaching source of issued test.

Program built with system defaults:
$ x86_64-pc-linux-gnu-gcc -o conftest -march=native -O2 -pipe -errwarn=%all -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\) -Wl,-O1 -Wl,--as-needed conftest.c
produces core.

Decreasing optimization to -O1, i.e compilling with:
$ x86_64-pc-linux-gnu-gcc -o conftest -march=native -O1 -pipe -errwarn=%all -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\) -Wl,-O1 -Wl,--as-needed conftest.c
Or removing -errwarn option with -O2:
$ x86_64-pc-linux-gnu-gcc -o conftest -march=native -O2 -pipe -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\) -Wl,-O1 -Wl,--as-needed conftest.c
makes program executable without core dumping.
Comment 8 Sergey Popov gentoo-dev 2015-09-16 08:38:17 UTC
Confirming this at least on amd64 with GCC 4.8.4
Comment 9 SpanKY gentoo-dev 2015-10-22 14:25:40 UTC
gcc-4.9 is stable now, so throwing away older bugs we don't plan on doing backports for as this should be fixed w/4.9+.  please re-open if it's still an issue with 4.9.3+ though.
Comment 10 Sergey S. Starikoff 2015-10-24 06:44:28 UTC
(In reply to SpanKY from comment #9)
> gcc-4.9 is stable now, so throwing away older bugs we don't plan on doing
> backports for as this should be fixed w/4.9+.  please re-open if it's still
> an issue with 4.9.3+ though.

You aren't right.
This issue was find at sys-devel/gcc:4.7 and confirmed at sys-devel/gcc:4.8.
So, proper resolution was TEST-REQUEST.

For now:
# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.9.3 *

The same source:
$ diff conftest.c conftest_4.9.c
shows no diffs

On the only reliably identified issued package produces the same error:
# ebuild /usr/portage/gentoo/net-fs/samba/samba-3.6.25.ebuild configure
# ls -l /tmp/cores/
итого 508
drwxrwxrwx  2 root    root        80 окт 24 09:19 ./
drwxrwxrwt 11 root    root       260 окт 24 09:19 ../
-rw-------  1 portage portage 294912 окт 24 09:19 core_conftest-11.5840
-rw-------  1 portage portage 892928 окт 24 09:19 core_conftest-6.9958

$ x86_64-pc-linux-gnu-gcc -o conftest -march=native -O2 -pipe -errwarn=%all  -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\) -Wl,-O1 -Wl,--as-needed conftest_4.9.c 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: warning: cannot find entry symbol rrwarn=%all; defaulting to 0000000000400410
$ ./conftest 
Ошибка сегментирования (core dumped)

For more complete revision packages for this issue feature from bug #560614 is needed.
Comment 11 SpanKY gentoo-dev 2015-10-24 16:42:35 UTC
the crash is irrelevant.  gcc does not support this flag.  as the output shows, it uses -exxx as a pass through to the linker.  hence the linker gets the weird flag which it treats as a symbol which messes up the link runtime.  the fact that old gcc happened to work is irrelevant.