Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 569816 - sys-apps/grep[pcre] with dev-libs/libpcre[-jit] fails test pcre-jitstack: grep: internal PCRE error: -21 (PCRE_ERROR_RECURSIONLIMIT)
Summary: sys-apps/grep[pcre] with dev-libs/libpcre[-jit] fails test pcre-jitstack: gre...
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://lists.gnu.org/archive/html/bu...
Whiteboard:
Keywords: TESTFAILURE
: 584074 584134 609412 675422 721354 744337 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-26 15:14 UTC by eroen
Modified: 2022-07-23 04:36 UTC (History)
10 users (show)

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


Attachments
build.log (build.log,72.41 KB, text/plain)
2015-12-26 15:15 UTC, eroen
Details
Patch to skip pcre-jitstack test if sys-libs/libpcre is build without jit (0001-sys-apps-grep-2.25-Skip-pcre-jitstack-test.patch,2.23 KB, patch)
2017-01-06 13:51 UTC, gentoo_usr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2015-12-26 15:14:34 UTC
FAIL: pcre-jitstack
===================

++ initial_cwd_=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests gt-pcre-jitstack.XXXX
+++ case $# in
+++ destdir_=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests
+++ template_=gt-pcre-jitstack.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
++++ unset TMPDIR
+++ d=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
+++ case $d in
+++ test -d /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
++++ tr S -
++++ LC_ALL=C
++++ env -- tr S -
++++ ls -dgo /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
+++ perms='drwx------ 2 4096 Dec 26 12:40 /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq'
+++ case $perms in
+++ test 0 = 0
+++ echo /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
+++ return
++ test_dir_=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
++ cd /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ../src
+ test 1 '!=' 0
+ path_dir_=../src
+ case $path_dir_ in
+ abs_path_dir_=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/../src
+ case $abs_path_dir_ in
+ PATH=/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/../src:/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/src:/usr/lib/portage/python3.4/ebuild-helpers/xattr:/usr/lib/portage/python3.4/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3
+ create_exe_shims_ /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/../src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ require_pcre_
+ grep -P .
+ echo .
.
+ compare /dev/null err
+ compare_dev_null_ /dev/null err
+ test 2 = 2
+ test x/dev/null = x/dev/null
+ test -s err
+ return 0
+ return 0
++ echo
+ nl_base64=Cg==
+ test XCg== = XCg==
+ foo=foo
+ test Xfoo = Xfoo
+ fail=0
+ base64 -d
+ test 0 -eq 0
+ gzip -d pcrejit.txt
+ LC_ALL=C
+ grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt
grep: internal PCRE error: -21
+ test 2 '!=' 1
+ ulimit -s unlimited
+ :
+ ulimit -s unlimited
+ LC_ALL=C
+ grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt
grep: internal PCRE error: -21
+ test 2 = 1
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests
+ chmod -R u+rwx /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
+ rm -rf /var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests/gt-pcre-jitstack.lUuq
+ exit 1
FAIL pcre-jitstack (exit status: 1)

...

============================================================================
Testsuite summary for GNU grep 2.22
============================================================================
# TOTAL: 95
# PASS:  88
# SKIP:  4
# XFAIL: 2
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to bug-grep@gnu.org
============================================================================
Makefile:1685: recipe for target 'test-suite.log' failed
make[3]: *** [test-suite.log] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests'
Makefile:1791: recipe for target 'check-TESTS' failed
make[2]: *** [check-TESTS] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests'
Makefile:2522: recipe for target 'check-am' failed
make[1]: *** [check-am] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-apps/grep-2.22/work/grep-2.22/tests'
Makefile:1277: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
 * ERROR: sys-apps/grep-2.22::gentoo failed (test phase):
 *   Make check failed. See above for details.
 * 
 * Call stack:
 *            ebuild.sh, line   90:  Called src_test
 *          environment, line 2238:  Called default
 *   phase-functions.sh, line  763:  Called default_src_test
 *   phase-functions.sh, line  792:  Called __eapi0_src_test
 *     phase-helpers.sh, line  760:  Called die
 * The specific snippet of code:
 *   		$emake_cmd ${internal_opts} check || \
 *   			die "Make check failed. See above for details."
Comment 1 eroen 2015-12-26 15:15:41 UTC
Created attachment 420882 [details]
build.log
Comment 2 eroen 2015-12-26 15:16:35 UTC
localhost ~ # emerge --info '=sys-apps/grep-2.22::gentoo'
Portage 2.2.24 (python 3.4.3-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 4.1.7-hardened-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.7-hardened-r1-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-gentoo-2.2
KiB Mem:     1874040 total,   1679460 free
KiB Swap:          0 total,         0 free
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-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-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
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"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri gdbm hardened iconv ipv6 justify mmx mmxext modules multilib ncurses nls nptl openmp pam pax_kernel pcre pie readline seccomp session sse sse2 ssl ssp tcpd unicode urandom xattr xtpax 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" 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="keyboard mouse evdev" 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" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

localhost ~ # emerge -pqv '=sys-apps/grep-2.22::gentoo' libpcre
[ebuild   R   ] dev-libs/libpcre-8.38  USE="bzip2 cxx readline recursion-limit (unicode) zlib -jit -libedit -pcre16 -pcre32 -static-libs" ABI_X86="(64) -32 (-x32)" 
[ebuild     U ] sys-apps/grep-2.22 [2.21-r1] USE="nls pcre -static" 

 * IMPORTANT: 10 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Comment 3 SpanKY gentoo-dev 2015-12-28 18:14:36 UTC
happens on non-hardened systems too for all libpcre versions in the tree, so doesn't look like a regression

error 21 is:
#define PCRE_ERROR_RECURSIONLIMIT  (-21)

and indeed this particular testcase exercises pcre heavily.  while pcre shouldn't fail, sometimes regexes are too expensive to be able to execute.  in this case, we probably want to skip this test when the pcre jit isn't available.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2016-05-25 06:35:20 UTC
*** Bug 584074 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2016-05-26 02:52:50 UTC
*** Bug 584134 has been marked as a duplicate of this bug. ***
Comment 6 gentoo_usr 2017-01-06 13:51:43 UTC
Created attachment 458950 [details, diff]
Patch to skip pcre-jitstack test if sys-libs/libpcre is build without jit

The test failure is not the fault of grep. It's the "fault" of libpcre.

Attached a patch to skip the pcre-jitstack test. It consists of two parts:
1) A patch to the grep sources to skip the pcre-jitstack test,
2) A patch to grep-2.25.ebuild to apply 1) if sys-libs/libpcre is build without jit.
Comment 7 SpanKY gentoo-dev 2017-02-15 15:37:17 UTC
*** Bug 609412 has been marked as a duplicate of this bug. ***
Comment 8 Étienne Buira 2018-09-22 06:31:16 UTC
This still holds true for grep-3.0
Comment 9 Rolf Eike Beer archtester 2018-10-19 19:59:49 UTC
Same with 3.1 (on hppa).
Comment 10 Matt Turner gentoo-dev 2018-10-19 20:20:24 UTC
Someone could test the patch posted upstream: https://lists.gnu.org/archive/html/bug-grep/2017-11/msg00015.html
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2018-12-22 22:42:58 UTC
(In reply to Matt Turner from comment #10)
> Someone could test the patch posted upstream:
> https://lists.gnu.org/archive/html/bug-grep/2017-11/msg00015.html

fyi, this patch doesn't work: https://www.mail-archive.com/bug-grep@gnu.org/msg07068.html
Comment 12 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-01-14 19:41:40 UTC
*** Bug 675422 has been marked as a duplicate of this bug. ***
Comment 13 Rolf Eike Beer archtester 2020-01-04 10:53:16 UTC
Same with 3.3-r1 on hppa without jit. Sparc worked with jit.
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-19 01:09:17 UTC
*** Bug 721354 has been marked as a duplicate of this bug. ***
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-09-23 14:16:59 UTC
*** Bug 744337 has been marked as a duplicate of this bug. ***
Comment 16 Rolf Eike Beer archtester 2020-10-08 16:19:26 UTC
Same in 3.4 on hppa.
Comment 17 Larry the Git Cow gentoo-dev 2022-05-03 23:57:58 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19c92a966c7f9b03da46dc047e4655e5e95aed30

commit 19c92a966c7f9b03da46dc047e4655e5e95aed30
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-03 23:56:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-03 23:57:07 +0000

    sys-apps/grep: add 3.7_p20220425 (unkeyworded).
    
    Notably switches to libpcre2 (yay). Pre-release for testing.
    
    Bug: https://bugs.gentoo.org/514454
    Bug: https://bugs.gentoo.org/569816
    Bug: https://bugs.gentoo.org/641186
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/grep/Manifest                  |  2 +
 sys-apps/grep/grep-3.7_p20220425.ebuild | 72 +++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
Comment 18 gentoo_usr 2022-07-12 18:23:42 UTC
grep-3.4 is gone from the Gentoo tree, so I think this issue can be closed.
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-13 03:59:24 UTC
(In reply to gentoo_usr from comment #18)
> grep-3.4 is gone from the Gentoo tree, so I think this issue can be closed.

Have you verified the issue no longer applies to newer greps?
Comment 20 gentoo_usr 2022-07-15 06:20:16 UTC
> (In reply to gentoo_usr from comment #18)
>> grep-3.4 is gone from the Gentoo tree, so I think this issue can be closed.
>
>Have you verified the issue no longer applies to newer greps?

Yes, grep-3.7 passes its test suite.
Comment 21 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-15 06:35:39 UTC
(In reply to gentoo_usr from comment #20)
> > (In reply to gentoo_usr from comment #18)
> >> grep-3.4 is gone from the Gentoo tree, so I think this issue can be closed.
> >
> >Have you verified the issue no longer applies to newer greps?
> 
> Yes, grep-3.7 passes its test suite.

with libpcre[-jit]?
Comment 22 Étienne Buira 2022-07-16 00:03:29 UTC
sys-apps/grep-3.7[pcre] passed tests here with dev-libs/libpcre-8.45-1[-jit]
Comment 23 gentoo_usr 2022-07-23 04:36:54 UTC
(In reply to Sam James from comment #21)
> (In reply to gentoo_usr from comment #20)
> > > (In reply to gentoo_usr from comment #18)
> > >> grep-3.4 is gone from the Gentoo tree, so I think this issue can be closed.
> > >
> > >Have you verified the issue no longer applies to newer greps?
> > 
> > Yes, grep-3.7 passes its test suite.
>
> with libpcre[-jit]?

Yes, sys-apps/grep with 'pcre' enabled and dev-libs/libpcre (and also dev-libs/libpcre2 fwiw) with 'jit' disabled.