If jit is enabled (which it is by default), PCRE crashes on a trivial regexp on big endian aarch64. This is very unfortunate since portage uses "grep -P" in the image directory, resulting in every package trying to install a file "/core"... Reproducible: Always Steps to Reproduce: 1.Build dev-libs/libpcre-8.45-r1 with USE=jit on big endian aarch64 2.Run "grep -P x /dev/null" 3. Actual Results: $ grep -P x /dev/null grep: program error Aborted (core dumped) $ Expected Results: $ grep -P x /dev/null $ (no crash) Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/arm64/17.0/big-endian, gcc-11.3.0, glibc-2.35-r8, 5.4.206 aarch64_be) ================================================================= System uname: Linux-5.4.206-aarch64_be-with-glibc2.35 KiB Mem: 6083772 total, 4498700 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Sun, 04 Dec 2022 10:00:01 +0000 Head commit of repository gentoo: e71d31144780c530f96060005904503c0f23e780 sh bash 5.1_p16-r1 ld GNU ld (Gentoo 2.38 p4) 2.38 app-misc/pax-utils: 1.3.4::gentoo app-shells/bash: 5.1_p16-r1::gentoo dev-lang/perl: 5.34.1-r3::gentoo dev-lang/python: 3.10.8_p3::gentoo dev-util/cmake: 3.23.3::gentoo dev-util/meson: 0.62.2::gentoo sys-apps/baselayout: 2.8::gentoo sys-apps/openrc: 0.45.2-r1::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.71-r5::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.38-r2::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 13.0.1::gentoo sys-devel/gcc: 11.3.0::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/llvm: 13.0.1::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.35-r8::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 crossdev location: /usr/local/portage-crossdev masters: gentoo priority: 10 ACCEPT_KEYWORDS="arm64" ACCEPT_LICENSE="@FREE" CBUILD="aarch64_be-unknown-linux-gnu" CFLAGS="-O2 -pipe -fomit-frame-pointer" CHOST="aarch64_be-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" 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="-O2 -pipe -fomit-frame-pointer" DISTDIR="/tmp/distfiles" EMERGE_DEFAULT_OPTS="--autounmask" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox 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" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="sv_SE.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" 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" SHELL="/bin/bash" USE="acl arm64 big-endian bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl test-rust unicode xattr zlib" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a1b58e6db608c2e972494ec8f73abe56731da34 commit 2a1b58e6db608c2e972494ec8f73abe56731da34 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-05 00:00:08 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-05 00:00:08 +0000 profiles/arch/arm64/big-endian: mask dev-libs/libpcre[jit] libpcre1 is EOL now so just mask and move on. Closes: https://bugs.gentoo.org/884285 Signed-off-by: Sam James <sam@gentoo.org> profiles/arch/arm64/big-endian/package.use.mask | 7 +++++++ 1 file changed, 7 insertions(+)
What is using grep -P? I don't think Portage should rely on grep being built with PCRE support, as it's not required by POSIX. I don't see any usage immediately but I didn't look super hard.
It's /usr/lib/portage/python3.10/install-qa-check.d/60pkgconfig which contains the line if grep -qP '=(/usr)?/lib\b' ${f} ; then
(In reply to Marcus Comstedt from comment #3) > It's /usr/lib/portage/python3.10/install-qa-check.d/60pkgconfig which > contains the line > > if grep -qP '=(/usr)?/lib\b' ${f} ; then Thanks, we figured it out in -portage, forgot to update bug. PR: https://github.com/gentoo/portage/pull/957
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=ddaf25365f74227dc581b9e2c38b0c0cc9c6d6b5 commit ddaf25365f74227dc581b9e2c38b0c0cc9c6d6b5 Author: Oskari Pirhonen <xxc3ncoredxx@gmail.com> AuthorDate: 2022-12-05 01:22:07 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-10 01:46:43 +0000 install-qa-check.d/60pkgconfig: remove PCRE The pattern in question works with both `grep -P` and `grep -E`, prefer the latter to avoid having to check if grep is built with PCRE support. '=(/usr)?/lib\b' Bug: https://bugs.gentoo.org/884285 Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Closes: https://github.com/gentoo/portage/pull/957 Signed-off-by: Sam James <sam@gentoo.org> NEWS | 2 ++ bin/install-qa-check.d/60pkgconfig | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84b50e99241623bf5557cea8e00a8178b9f01e14 commit 84b50e99241623bf5557cea8e00a8178b9f01e14 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-26 07:16:56 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-26 07:17:16 +0000 sys-apps/portage: add 3.0.42 Bug: https://bugs.gentoo.org/881383 Bug: https://bugs.gentoo.org/882797 Closes: https://bugs.gentoo.org/884397 Closes: https://bugs.gentoo.org/884135 Closes: https://bugs.gentoo.org/884285 Closes: https://bugs.gentoo.org/887025 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.42.ebuild | 283 +++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+)