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

Bug 574306

Summary: sys-apps/portage: compiler QA checks should use `grep -a` on log files
Product: Portage Development Reporter: William Throwe <wtt6>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: itumaykin+gentoo, sbraz
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 573774    
Attachments: games-roguelike/nethack build.log.gz
build.log.gz with --debug

Description William Throwe 2016-02-10 02:44:51 UTC
Created attachment 425100 [details]
games-roguelike/nethack build.log.gz

While emerging games-roguelike/nethack-3.6.0-r2, I am informed

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * Binary file (standard input) matches

 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: http://www.nethack.org/

I somehow doubt that upstream would appreciate such a bug report.

$ emerge --info portage
Portage 2.2.27 (python 2.7.11-final-0, default/linux/amd64/13.0, gcc-5.3.0, glibc-2.22-r1, 4.1.4-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.4-gentoo-x86_64-Intel-R-_Core-TM-2_CPU_T5500_@_1.66GHz-with-gentoo-2.2
KiB Mem:     2048864 total,    681096 free
KiB Swap:    2048252 total,   1476620 free
Timestamp of repository gentoo: Tue, 09 Feb 2016 07:45:01 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p42-r2::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.3-r7::gentoo
dev-util/cmake:           3.4.3::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.20.4::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.namerica.gentoo.org/gentoo-portage
    priority: -1000

crossdev
    location: /usr/local/crossdev
    masters: gentoo
    priority: 0

g-cpan
    location: /var/lib/g-cpan
    masters: gentoo
    priority: 1

rust
    location: /var/lib/layman/rust
    masters: gentoo
    priority: 50

wthrowe
    location: /var/lib/layman/wthrowe
    masters: gentoo
    priority: 50

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE fairuse"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /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=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask --quiet-build=n --autounmask-write=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.netnitco.net http://mirror.mcs.anl.gov/pub/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo"
LANG="POSIX"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl acpi alsa amd64 berkdb bindist bzip2 cairo caps cdr cli cracklib crypt cxx dbus dri dvd dvdr emacs fortran gd gdbm gif gimp gtk iconv ipv6 jpeg latex mmx mmxext modules mp3 multilib ncurses nls nptl opengl openmp pam pcre png readline seccomp session smp sse sse2 ssl ssse3 tcpd tiff truetype unicode xattr xscreensaver zlib" ABI_X86="64" 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" 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" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" 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 ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/portage-2.2.27::gentoo was built with the following:
USE="(ipc) xattr -build -doc -epydoc (-selinux)" ABI_X86="64" LINGUAS="-ru" PYTHON_TARGETS="python2_7 python3_4 (-pypy) -python3_3 -python3_5"
Comment 1 SpanKY gentoo-dev 2016-02-13 11:31:40 UTC
we're already running grep through LC_CTYPE=C which means it shouldn't trigger the binary warning due to encoding issues, and that log file has no embedded NULs.  so it shouldn't be triggering that state.

does this happen every time ?  if so, re-run emerge with the --debug flag and attach that full log here please.
Comment 2 William Throwe 2016-02-16 00:49:40 UTC
Created attachment 425608 [details]
build.log.gz with --debug

This does happen consistently.  --debug build log attached.  Experimenting with running zgrep on the log file, I get the expected output with my standard LC_CTYPE=en_US.UTF-8 but "Binary file (standard input) matches" with LC_CTYPE=C (as is done by portage).

Here are my locale settings, in case that's useful:
LANG=POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="POSIX"
LC_TIME=en_DK.UTF-8
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Comment 3 Louis Sautier (sbraz) gentoo-dev 2016-03-04 11:30:32 UTC
I experiment the same behaviour. I can confirm that changing LC_CTYPE to something like en_US.UTF-8 in /usr/lib64/portage/python3.5/install-qa-check.d/90gcc-warnings fixes the issue.
I'm afraid --debug will not add anything relevant as debugging is disabled by the QA script:
https://github.com/gentoo/portage/blob/master/bin/install-qa-check.d/90gcc-warnings#L8

LC_CTYPE=C grep 'implicit declaration' /var/tmp/portage/net-irc/eggdrop-1.6.21-r1/temp/build.log
Binary file /var/tmp/portage/net-irc/eggdrop-1.6.21-r1/temp/build.log matches
# LC_CTYPE=en_US.UTF-8 grep 'implicit declaration' /var/tmp/portage/net-irc/eggdrop-1.6.21-r1/temp/build.log
.././mc_greet.mod/mc_data.c:129:2: warning: implicit declaration of function ‘chmod’ [-Wimplicit-function-declaration]
 * .././mc_greet.mod/mc_data.c:129:2: warning: implicit declaration of function ‘chmod’ [-Wimplicit-function-declaration]
# file /var/tmp/portage/net-irc/eggdrop-1.6.21-r1/temp/build.log
/var/tmp/portage/net-irc/eggdrop-1.6.21-r1/temp/build.log: UTF-8 Unicode text, with very long lines, with CRLF, CR, LF line terminators, with escape sequences
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2016-03-04 11:39:12 UTC
yet more  LC_ issues
Comment 5 Coacher 2016-05-17 18:28:40 UTC
Fixed in https://github.com/gentoo/portage/commit/91e1dd94c1615bf97d5bc42dac4d64876919e768, which is included in 2.3.0_rc1.