Closed sisyphus-ppcg closed 2 years ago
Bisection points to commit 5b4a51d7c850b274c4a37452f256afb7cd5013c1 from August 2017.
commit 5b4a51d7c850b274c4a37452f256afb7cd5013c1
Author: Zefram <zefram@fysh.org>
AuthorDate: Sun Mar 26 21:53:29 2017 +0100
Commit: Steve Hay <steve.m.hay@googlemail.com>
CommitDate: Tue Aug 29 08:16:46 2017 +0100
set up catchable runloops early enough
Since the author is no longer active, can someone take a look at this? @tonycoz, @demerphq, @steve-m-hay perhaps?
Complication: When, on a machine different from the one on which I did the bisection, I tried to build perl at the commit identified above as "first bad," the build failed like this:
cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
Attempt to free unreferenced scalar: SV 0x5636338232b0.
Segmentation fault
Failed to build miniperl. Please run make minitest
make: *** [makefile:364: lib/buildcustomize.pl] Error 1
So there's a possibility that the bisection may have found a different problem.
I can't reproduce on blead. Perhaps this is already fixed in latest blead?
./perl -le'@x= sort { eval "(" } (1,2); print $@';
syntax error at (eval 1) line 1, at EOF
./perl -v
This is perl 5, version 37, subversion 4 (v5.37.4 (v5.37.2-449-gcb80945103)) built for x86_64-linux-thread-multi
Copyright 1987-2022, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.
Wouldn't surprise me if the commits I merged recently fixed this, although I have not bisected.
I think this can be closed unless someone can come up with a reproduction script for latest blead.
Yep seems fixed in blead for me as well. I'll close this for now.
FWIW, I think it was probably fixed by the patches in #20182
Okay, so for the record, let's now try to bisect to find out when the code in question no longer crashed. Using this invocation:
perl Porting/bisect.pl \
--start=v5.36.0 \
--expect-fail -e '@a = sort{eval"("}1,2'
... I got this commit:
commit 16e43efd81368f85ada6f2d40658b305d92ba57e (HEAD, refs/bisect/bad)
Author: David Mitchell <davem@iabyn.nospamdeletethisbit.com>
AuthorDate: Sat Jul 9 14:20:07 2022 +0100
Commit: David Mitchell <davem@iabyn.nospamdeletethisbit.com>
CommitDate: Sat Jul 9 14:31:17 2022 +0100
fix another panic from eval {} inside /(?{...})/
GH #19390
Extra test cases should be added for it;
Also in combination with BEGIN
and UNITCHECK
, something like (untested): @a = sort{eval" UNITCHECK{die}"}1,2
@bram-perl done: https://github.com/Perl/perl5/pull/20263
Description An eval that results in a syntax error inside of a
sort
causes a segmentation fault. This reproduces on v5.36.0 and v5.30.0 but does not segfault on a very old version of Perl (v5.16.3) so it was introduced somewhere between those versions.Steps to Reproduce Run the following code:
Expected behavior No segfault.
Perl configuration