summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2015-03-17 17:19:23 +0100
committerNicholas Clark <nick@ccl4.org>2015-03-17 17:31:41 +0100
commita24da70b9c071e0d13c52a50085b8790d36b5ba8 (patch)
tree6a7f16d14ae739b5ef55be44b30c7693bebbccb0 /perl.c
parent88203927dfd53d8b5cfca0639c2ed67e4bbe39d2 (diff)
downloadperl-a24da70b9c071e0d13c52a50085b8790d36b5ba8.tar.gz
PL_custom_op{s,_names,_descs} should be set to NULL in perl_destruct().
Otherwise SEGVs and other jollity can happen if the interpreter is created a second (or subsequent) time, and modules attempt to register custom OPs (using either the old or new approaches). These appear to have been bugs since the relevant code was introduced (new approach in v5.14.0, old approach in v5.8.0) This probably only affects mod_perl built against a perl without ithreads, which makes it unlikely that many folks hit it with OS distributions. You'd need to (at least) be building your own perl, using mod_perl, and using a module that uses custom OPs.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index 76ba1b46c7..afa2107739 100644
--- a/perl.c
+++ b/perl.c
@@ -1313,6 +1313,13 @@ perl_destruct(pTHXx)
Perl_reentrant_free(aTHX);
#endif
+ /* These all point to HVs that are about to be blown away.
+ Code in core and on CPAN assumes that if the interpreter is re-started
+ that they will be cleanly NULL or pointing to a valid HV. */
+ PL_custom_op_names = NULL;
+ PL_custom_op_descs = NULL;
+ PL_custom_ops = NULL;
+
sv_free_arenas();
while (PL_regmatch_slab) {