Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 75bedfb8dffceedb73beb63be21076e0956886b2 https://github.com/Perl/perl5/commit/75bedfb8dffceedb73beb63be21076e0956886b2 Author: David Mitchell <da...@iabyn.com> Date: 2024-02-16 (Fri, 16 Feb 2024)
Changed paths: M ext/XS-APItest/APItest.xs Log Message: ----------- avoid ext/XS-APItest/t/clone-with-stack.t crash a fresh_perl() TODO test in this file does something like use XS::APItest; BEGIN { clone_with_stack(); } print "ok\n"; As a standalone program, this code gives errors under valgrind, and in ticket GH #21969 was causing "perl.exe has stopped working" on Windows 8. The clone_with_stack() XS function is fairly dodgy - it clones the whole interpreter including stacks (i.e. what fork() emulation on windows does), but then continues the RUNOPS loop to completion itself, using the cloned interpreter, rather than relying on the caller to finish the ops loop. This doesn't work very well under BEGIN (hence why it's a TODO test), but specifically, PL_curcop can be left pointing at an op which gets freed , but then is later accessed anyway. This commit resets PL_curcop to &PL_compiling to avoid crashes.