Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347491 - dev-lang/tcl-8.5.7 builds with gcc-4.5.1 and O1 and higher but exhibits coredumps easily
Summary: dev-lang/tcl-8.5.7 builds with gcc-4.5.1 and O1 and higher but exhibits cored...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 347501
  Show dependency tree
 
Reported: 2010-12-02 01:01 UTC by M. B.
Modified: 2010-12-02 11:30 UTC (History)
1 user (show)

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


Attachments
demonstration of the output (result-example.txt,11.46 KB, text/plain)
2010-12-02 01:06 UTC, M. B.
Details
emerge --info of the demonstration (emerge-info.txt,4.95 KB, text/plain)
2010-12-02 01:08 UTC, M. B.
Details
Backtrace (backtrace.log,11.42 KB, text/plain)
2010-12-02 01:52 UTC, Mike Gilbert
Details
Full backtrace. (backtrace.log,37.29 KB, text/plain)
2010-12-02 11:08 UTC, M. B.
Details
build.log for backtrace above (build.log,224.04 KB, text/plain)
2010-12-02 11:10 UTC, M. B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M. B. 2010-12-02 01:01:31 UTC
I recently switched to gcc-4.5.1 due to it providing -march=atom. Now, however, BRLCAD failed, stating that Iwidgets (a tcl package) could not be found.

When asking in the TCL channel for help i was told to check manually whether TCL knows the Iwidgets package via
tclsh
package require Iwidgets

This resulted in a coredump.

Reproducible: Always

Steps to Reproduce:
1. Use gcc-4.5.1. Set O1 or higher in CFLAGS.
2. emerge dev-lang/tcl-8.5.7 and dev-lang/Tk-8.5.7
3. run `tclsh`
4. run `package require Tk` or `package require Iwidgets`

Actual Results:  
This results in a buffer overflow.

Expected Results:  
Output "8.5.7" on the shell; creation of a generic Tk window in X.

Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.1/lto-wrapper
Ziel: x86_64-pc-linux-gnu
Konfiguriert mit: /var/tmp/portage/sys-devel/gcc-4.5.1-r1/work/gcc-4.5.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.1-r1 p1.3, pie-0.4.5'
Thread-Modell: posix
gcc-Version 4.5.1 (Gentoo 4.5.1-r1 p1.3, pie-0.4.5) 


Portage 2.2.0_alpha6 (default/linux/amd64/10.0, gcc-4.5.1, glibc-2.11.2-r3, 2.6.34-gentoo-r11 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r11-x86_64-Intel-R-_Atom-TM-_CPU_D525_@_1.80GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 01 Dec 2010 15:30:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r1
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.6
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2, 4.5.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
Repositories: gentoo science multimedia gamerlay-stable funroll-loops mine
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=atom -O0 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/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=atom -O0 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=6 --load-average=3"
FEATURES="assume-digests binpkg-logs ccache distcc distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch webrsync-gpg"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://gentoo.mneisen.org/ http://gentoo.supp.name/"
LANG="de"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en sv fr ru"
MAKEOPTS="-j8 --load-average=3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--delete-after"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/science /usr/portage/local/layman/multimedia /usr/portage/local/layman/gamerlay /usr/portage/local/layman/funroll-loops /usr/portage/local/mine"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="64bit X a52 aac aacs aalib accessibility acl acpi alsa amd64 amr aotuv archive bash-completion berkdb blksha1 bluray boost branding bzip2 cairo cdda cddax cdr cgi cleartype cli cracklib crypt css cups curl cxx daemon dbus device-mapper dga dia disk-partition dri dts dv dvd dvdr enca encode exif fam fastcgi fat ffmpeg flac fontconfig foomaticdb fortran fpm frei0r ftp fuse gallium gd gdbm geoip gif gimp git glitz gnutls gphoto2 gpm graphite gre gs gstreamer gtk hddtemp helpers hpn iconv icu id3tag idn imagemagick inkjar iostats ipv6 iso14755 ithreads jabber jadetex java java6 javascript jpeg jpeg2k kpathsea ladspa laptop latex libass libcaca libevent libnotify libv4l2 live lm_sensors lock lvm1 lyrics lzma lzo mad managesieve matroska mime mjpeg mmap mmx mmxext mng modules mp2 mp3 mp4 mpeg mpi mplayer msn mudflap multilib music ncurses network nls nodrm nptl nptlonly nsplugin ntfs ntp nuv octave offensive ogg openexr opengl openmp otr pam pcre pdf perl png pop3d postproc postscript ppds pppd python qt4 quicktime rar readline reiser4 reiserfs rss rtc samba schroedinger sdl secure-delete session sieve skins skype smp sound speex sse sse2 ssl ssse3 startup-notification stk subtitles subversion svg symlink sysfs system-sqlite tcpd templates theora threads thunar tidy tiff trayicon truetype twolame udev unicode upnp usb v4l2 vaapi vcd vda vdpau video videos vim-pager vim-syntax vim-with-x vorbis vpx vst wcwidth weather-metar weather-xoap webkit winpopup wma wps wxwidgets x264 xanim xcb xcomposite xfce xft xhtml xml xmlrpc xorg xosd xpm xscreensaver xv xvid xvmc yahoo zip zlib" ALSA_CARDS="hda-intel" 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="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" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en sv fr ru" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" 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" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 M. B. 2010-12-02 01:04:16 UTC
As you can see here, I am using -O0 in the CFLAGS - this actually fixes the problem. Using -O1 or -O2 causes the buffer overflow.
Comment 2 M. B. 2010-12-02 01:06:30 UTC
Created attachment 256081 [details]
demonstration of the output
Comment 3 M. B. 2010-12-02 01:08:35 UTC
Created attachment 256083 [details]
emerge --info of the demonstration

I asked for someone else to test this issue and it's reproducible on another computer with march=amdfam10. The other previously attached file is from this machine; my machine shows a similar output.
Comment 4 Rafał Mużyło 2010-12-02 01:22:32 UTC
On the off chance, that it's a trivial case and the warnings are there, could you attach build log of tcl (of the crashing build).

Otherwise, try getting a backtrace.

Though, IIRC, fortify should only be active on -O2, not -O1.
Comment 5 Mike Gilbert gentoo-dev 2010-12-02 01:52:37 UTC
Created attachment 256087 [details]
Backtrace

I am the "someone else" mentioned in #3. Here is a backtrace; the build log is long gone.
Comment 6 M. B. 2010-12-02 11:08:41 UTC
Created attachment 256143 [details]
Full backtrace.

Full backtrace.
dev-lang/tcl compiled with
  CFLAGS="-O1 -ggdb -march=atom -pipe"
  USE="-threads -debug"
  FEATURES="keeptemp keepwork nostrip"
dev-lang/tk compiled with
  CFLAGS="-O0 -march=atom -pipe"
  all USE-flags deactivated

executed commands were:
# tclsh
% require package Tk
Comment 7 M. B. 2010-12-02 11:10:31 UTC
Created attachment 256145 [details]
build.log for backtrace above
Comment 8 M. B. 2010-12-02 11:30:43 UTC
(In reply to comment #4)
> 
> Though, IIRC, fortify should only be active on -O2, not -O1.
> 

Heh. 8.5.8-r2 contains a "fortify.patch" - and the problem does not appear with 8.5.8-r2. It does, however, appear with 8.5.8-r1. So a change from 8.5.8-r1 to 8.5.8-r2 apparently fixes it.