Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924722 - app-arch/gzip runtime issue and failed test when compiled with sys-libs/fortify-headers enablled - cmp: EOF on - after byte 32768, in line 887
Summary: app-arch/gzip runtime issue and failed test when compiled with sys-libs/forti...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 546692
  Show dependency tree
 
Reported: 2024-02-16 13:42 UTC by immolo
Modified: 2024-02-16 19:22 UTC (History)
4 users (show)

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


Attachments
build.log (gzip.build.log,126.46 KB, text/x-log)
2024-02-16 13:42 UTC, immolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description immolo 2024-02-16 13:42:44 UTC
Created attachment 885152 [details]
build.log

This was found on a GCC14, musl with fortify-headers-9999 machine. I have ruled out as much as possible that the issue is related to GCC14 or musl however this shouldn't be assumed as fact.

When building gzip with fortify-headers a runtime issue happens when extracting tar.gzip archives:

>>> Unpacking source...
>>> Unpacking xz-5.4.6.tar.gz to /var/tmp/portage/app-arch/xz-utils-5.4.6-r1/work
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

When running FEATURES="test" on app-arch/gzip I find:

for opt in --rsyncable '' -1 -9; do		\
          for file in gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew ./ChangeLog ./configure ./gzip.c; do		\
            gzip $opt -c -- "$file"			\
              | gzip -d | cmp - "$file" || exit 1;	\
          done;						\
done
cmp: EOF on - after byte 32768, in line 887
make[3]: *** [Makefile:2531: check-local] Error 1
make[3]: Leaving directory '/var/tmp/portage/app-arch/gzip-1.13/work/gzip-1.13'
make[2]: *** [Makefile:2309: check-am] Error 2
make[1]: *** [Makefile:2011: check-recursive] Error 1
make: *** [Makefile:2311: check] Error 2
 * ERROR: app-arch/gzip-1.13::gentoo failed (test phase):
 *   Make check failed. See above for details.

I have tested setting USE="-pic" which had no difference on the test result.
Comment 1 immolo 2024-02-16 13:45:03 UTC
# emerge --info
Portage 3.0.61 (python 3.11.7-final-0, default/linux/amd64/23.0/musl/hardened, gcc-14, musl-1.2.4-r1, 6.7.4-gentoo-immolo x86_64)
=================================================================
System uname: Linux-6.7.4-gentoo-immolo-x86_64-Intel-R-_Core-TM-_i5-8350U_CPU_@_1.70GHz-with-libc
KiB Mem:     8020760 total,   4346492 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Fri, 16 Feb 2024 01:30:01 +0000
Head commit of repository gentoo: 2c012df379f458f614c12177d41fbaa035706390
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-build/autoconf:        2.71-r7::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.3::gentoo
dev-build/libtool:         2.4.7-r2::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.3.0-r2::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust-bin:         1.75.0::gentoo
sys-apps/baselayout:       2.14-r2::gentoo
sys-apps/openrc:           0.53::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.41-r3::gentoo, 2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20240113-r1::gentoo, 14.0.1_pre20240211-r1::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-kernel/linux-headers:  6.7::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.4-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 3

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/17.1/x86-64_musl_hardened

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-O2 -pipe -flto -march=native"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -flto -march=native"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -flto -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -flto -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
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"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet crypt cups dbus dri dts dvd dvdr elogind encode exif flac gif gpm gtk gui hardened iconv icu ipv6 jpeg lcms libnotify libtirpc lzma mad mng mp3 mp4 mpeg ncurses nls ogg opengl pam pango pcre pdf pic pie png policykit ppds readline sdl seccomp sound spell ssl ssp startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wxwidgets x264 xattr xcb xft xml xtpax xv xvid zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 immolo 2024-02-16 18:45:52 UTC
Steps to reproduce:

1. Set up a fortify-headers system following https://wiki.gentoo.org/wiki/User:Immolo/Fortify_Headers

(Don't run the emerge -e @world while following)

2. FEATURES="test" emerge -va1 app-arch/gzip
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-16 19:22:33 UTC
(In reply to immolo from comment #0)
> Created attachment 885152 [details]
> build.log
> 
> This was found on a GCC14, musl with fortify-headers-9999 machine. I have
> ruled out as much as possible that the issue is related to GCC14 or musl
> however this shouldn't be assumed as fact.


so you can reproduce w/ gcc-13+musl?