ssia. 3.2.8 Reproducible: Always
sorry I failed to enter description. Symptoms which I experienced. 3.2.8-r2 w/ -Os on ~ppc vomits SEGV on running sysctl. 3.2.8_p10-r1 w/ -Os on ~ppc hang up on running top. 3.2.8_p10-r1 w/ -O2 on ~ppc, no problem for top, sysctl or so. i'd suggest to add "replace-flags -Os -O2". FYI, my emerge --info: Portage 2.1.10.7 (default/linux/powerpc/ppc32/10.0, gcc-4.5.2, glibc-2.13-r4, 3.0.0-gentoo ppc) ================================================================= System uname: Linux-3.0.0-gentoo-ppc-7447A,_altivec_supported-with-gentoo-2.0.3 Timestamp of tree: Fri, 29 Jul 2011 03:15:01 +0000 ccache version 3.1.5 [enabled] app-shells/bash: 4.2_p10 dev-lang/python: 2.7.2-r2, 3.2-r2 dev-util/ccache: 3.1.5 dev-util/cmake: 2.8.5-r2 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.8.3-r1 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.68 sys-devel/automake: 1.11.1-r1 sys-devel/binutils: 2.21.1 sys-devel/gcc: 4.5.2 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 2.6.38 (virtual/os-headers) sys-libs/glibc: 2.13-r4 Repositories: gentoo x-crossdev hiyuh ACCEPT_KEYWORDS="ppc ~ppc" ACCEPT_LICENSE="* -@EULA" CBUILD="powerpc-unknown-linux-gnu" CFLAGS="-Os -mcpu=G4 -mtune=G4 -maltivec -mabi=altivec -Wall" CHOST="powerpc-unknown-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-Os -mcpu=G4 -mtune=G4 -maltivec -mabi=altivec -Wall" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs ccache collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox" FFLAGS="" GENTOO_MIRRORS=" http://gentoo.channelx.biz/ http://gentoo.gg3.net/ ftp://gg3.net/pub/linux/gentoo/ ftp://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ rsync://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/ ftp://ftp.jaist.ac.jp/pub/Linux/Gentoo/ " LANG="ja_JP.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en ja" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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/local/overlay/crossdev /usr/local/overlay/hiyuh" SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage" USE="X acl altivec bash-completion berkdb bzip2 caps cli cracklib crypt cxx dri fontconfig fortran gdbm gpm gtk3 iconv icu jbig jpeg jpeg2k lzma modules mudflap ncurses nls nptl nptlonly opengl openmp png ppc readline session ssl svg sysfs t1lib tcpd threads tiff truetype unicode vim-syntax xcb xorg zlib" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie" 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ja" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev radeon" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
It looks like the most important part of this is *ppc* and not *-Os*. Does -Os work on x86/amd64/other architectures?
Hi matt works for me on amd64 with -Os.
(In reply to comment #3) > Hi matt > > works for me on amd64 with -Os. Thanks Agostino. That tells me that it's definitely related to ppc.
more likely a gcc bug ...
(In reply to comment #5) > more likely a gcc bug ... FYI, i tried gcc-4.5.3, but no effect. 3.2.8_p10-r1 w/ -Os on ~ppc hang up on running top. 3.2.8_p10-r1 w/ -O2 on ~ppc, no problem for top, sysctl or so.
FYI, i tried gcc-4.5.3-r1, but no effect. 3.2.8_p11 w/ -Os on ~ppc hang up on running top. 3.2.8_p11 w/ -O2 on ~ppc, no problem for top.
i can reproduce this on a ppc32 with "-Os". funny enough, adding "-g" causes it to start working. the hang happens before main() is even called. seems to be init_libproc() constructor which calls init_Linux_version() which attempts to return, but fails. seems like it keeps returning to itself. removing the sscanf() from the func makes a difference. but the sscanf call looks fine to me. i'm no ppc asm pro, so i can't easily single step through this stuff and see where it's going wrong.
Created attachment 292467 [details] reduced test case $ gcc -Os -pipe test.c -frename-registers -fpic $ ./a.out <hang>
FYI, i tried gcc-4.5.3-r2. 3.3.2_p2-r1 w/ -Os on ~ppc, no problem for top or so.
If 4.6 doesn't work, care to send this upstream?
afaict, this is fixed with gcc-4.7+