This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make PL_utf8_foldclosures interpreter level
authorKarl Williamson <khw@cpan.org>
Mon, 18 May 2020 20:40:04 +0000 (14:40 -0600)
committerSawyer X <xsawyerx@cpan.org>
Tue, 2 Jun 2020 09:17:47 +0000 (12:17 +0300)
commit668d19980931e86058b46a58d0328c3b881b8aa1
tree24af2a04d7083dfb544b75a6920ce1cc48fa36f0
parentcac6698e074af8daec0f7011cd77824d5d849d6f
Make PL_utf8_foldclosures interpreter level

This resolves #17774.

This ticket is because the fixes in GH #17154 failed to get every case,
leaving this one outlier to be fixed by this commit.

The text in https://github.com/Perl/perl5/issues/17154 gives extensive
details as to the problem.  But briefly, in an attempt to speed up
interpreter cloning, I moved certain SVs from interpreter level to
global level in e80a0113c4a8036dfb22aec44d0a9feb65d36fed (v5.27.11,
March 2018).  This was doable, we thought, because the content of these
SVs is constant throughout the life of the program, so no need to copy
them when cloning a new interpreter or thread.  However when an
interpreter exits, all its SVs get cleaned up, which caused these to
become garbage in applications where another interpreter remains
running.  This circumstance is rare enough that the bug wasn't reported
until September 2019,  #17154.  I made an initial attempt to fix the
problem, and closed that ticket, but I overlooked one of the variables,
which was reported in #17774, which this commit addresses.

Effectively the behavior is reverted to the way it was before
e80a0113c4a8036dfb22aec44d0a9feb65d36fed.
embedvar.h
intrpvar.h
perl.c
perlapi.h
perlvars.h
sv.c