On Sun, Oct 25, 2015 at 4:02 PM, Bruce Dubbs <bruce.du...@gmail.com> wrote: > Paul Eggert wrote: >> >> Bruce Dubbs wrote: >>> >>> I would think that the tests in grep should account for both pcre and >>> pcre2, at >>> least for a couple of years. >> >> >> Grep currently supports only PCRE. I'd be surprised if it worked with >> PCRE2. >> >> My test was with PCRE 8.35 with Debian and Ubuntu patches (I'm >> up-to-date with Ubuntu 15.10 on x86-64). Yours was with 8.37, I assume >> with no patches. Perhaps if I find the time I can try building PCRE 8.37 >> on Ubuntu 15.10 and see whether it exhibits the bug, but to be honest I >> was hoping someone else could debug this. Perhaps you can try it with >> 8.35 on linuxfromscratch? > > > Yes, I can do that. The main Upstream repo doesn't have 8.35, but it was at > sourceforge. I installed that: > > -rwxr-xr-x 1 root root 762440 Oct 25 17:43 /lib/libpcre.so.1.2.3 > > but the pcre-jitstack test still aborts with a segfault. I could try with a > smaller pcrejit.txt file if that would help. > > OK, I think I have it. I had a default ulimit: > > stack size (kbytes, -s) 8192 > > when I changed that to unlimited, the test passed. More testing and ulimit > -s 16000 fails but ulimit -s 32000 passes.
Thanks for investigating. I wonder why your libpcre-8.37 needs so much stack and mine (built from the release tarball by me, with no patch) segfaults only when I restrict stack to less than about 50 KB. I.e.,this exits with status 1: ( ulimit -s 50; LC_ALL=C src/grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt ) but changing to a ulimit of 40 KB, it consistently segfaults. That also jibes with what valgrind --tool=massif --stacks=yes reports.