Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 400905

Summary: net-libs/udns please add filter-flags -fpeel-loops used with -03 or -0s
Product: Gentoo Linux Reporter: Marcin Mirosław <bug>
Component: Current packagesAssignee: Pavlos Ratis (RETIRED) <dastergon>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: http://www.mail-archive.com/jabberd2@lists.xiaoka.com/msg02225.html , http://www.corpit.ru/pipermail/udns/2013q4/000169.html
See Also: https://bugs.gentoo.org/show_bug.cgi?id=498662
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 498662    
Bug Blocks:    

Description Marcin Mirosław 2012-01-26 12:33:52 UTC
net-libs/udns behaves incorrectly when is compiled with -03 or -0s together with -fpeel-loops. It doesn't return resolved addressed to application. I have very strange and annoying problems using net-im/jabberd2 when net-libs/udns was compiled with mentioned pair of CFLAGS.
I didn't try on other platforms than AMD64, gcc-4.5.3 hardened.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-01-27 15:48:09 UTC
Please post your `emerge --info' output in a comment.
Comment 2 Marcin Mirosław 2012-01-27 17:14:18 UTC
# emerge --info
Portage 2.2.0_alpha84 (hardened/linux/amd64, gcc-4.5.3, glibc-2.13-r4, 3.1.8-hardened x86_64)
=================================================================
System uname: Linux-3.1.8-hardened-x86_64-Intel-R-_Core-TM-_i7_CPU_930_@_2.80GHz-with-gentoo-2.0.3
Timestamp of tree: Fri, 27 Jan 2012 08:30:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.2
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
Installed sets:
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe         -fpeel-loops    -fgraphite-identity -floop-interchange -floop-block -floop-strip-mine -fira-loop-pressure       -fpredictive-commoning -freorder-blocks-and-partition -ftracer -ftree-loop-distribution -ftree-vectorize        --param l2-cache-size=128 --param l1-cache-size=16 --param l1-cache-line-size=32 -s"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /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.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe       -fpeel-loops    -fgraphite-identity -floop-interchange -floop-block -floop-strip-mine -fira-loop-pressure       -fpredictive-commoning -freorder-blocks-and-partition -ftracer -ftree-loop-distribution -ftree-vectorize        --param l2-cache-size=128 --param l1-cache-size=16 --param l1-cache-line-size=32 -s"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=" --quiet-build=n"
FEATURES="Xkeepwork Xprofile Xtest assume-digests binpkg-logs ccache collision-protect distlocks ebuild-locks fail-clean fixlafiles news parallel-fetch preserve-libs profile-use protect-owned sandbox sfperms Xsplitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mneisen.org/"
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl en"
MAKEOPTS="-j2 -l2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-O"
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=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acpi amd64 apache2 bash-completion caps hardened idn iproute2 ipv6 mmap mmx mmxext multilib nls openssl slang smp sse sse2 sse3 sse4 sse4a ssse3 syslog threads threadsafe unicode vhosts vim-syntax" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon auth_digest authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user cache cgid dav dav_fs dav_lock dir env expires ext_filter filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif status unique_id usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" KERNEL="linux" LINGUAS="pl en" NGINX_MODULES_HTTP="access browser charset gzip map limit_zone proxy rewrite stub_status" PHP_TARGETS="php5-3" USERLAND="GNU" XTABLES_ADDONS="geoip ipset6 psd sysrq tarpit"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 3 Pacho Ramos gentoo-dev 2013-10-13 13:00:55 UTC
Is this still valid with gcc-4.7 and latest udns?
Comment 4 Marcin Mirosław 2013-10-14 08:32:53 UTC
I've tested with:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /dane/domeny/PORT/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-cloog --with-ppl --with-cloog-include=/usr/include/cloog-ppl --disable-ppl-version-check --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.7.3/python --enable-checking=release --disable-libgcj --enable-libstdcxx-time --disable-libquadmath --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5'
Thread model: posix
gcc version 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5) 

Nor with "-O3" nor with "-Os" I couldn't reproduce problem. Miscompilation appears when I've added "-fpeel-loops" but probably all CFLAGS beside "-O2" are treated as unsafe?;)
Comment 5 Pacho Ramos gentoo-dev 2013-10-14 21:02:29 UTC
Yeah, I am unsure about adding it to filter-flags will deserve the effort (as there are another ton of cflags that could break it too :/)
Comment 6 Marcin Mirosław 2013-12-29 21:24:50 UTC
It looks on SPARC udns doesn't work correctly even with -O2.
Comment 7 Wolfram Schlich (RETIRED) gentoo-dev 2014-04-26 15:22:14 UTC
Should be fixed in 0.4.