From 5c64bffd0d9c35e88b9ac48fc997977163abcc50 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 26 Jun 2013 18:01:09 +0200 Subject: Fix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATE With PERL_GLOBAL_STRUCT_PRIVATE "global" variables are in a structure in malloc()ed memory, not in global static variables or a global static structure. Hence no global variables are implicitly initialised to zero. * PL_curinterp and PL_op_sequence need initialising to NULL * The global structure is free()d before handlers registered with atexit() run, so be defensive about this. * Some C code checks SvOK(PL_sv_placeholder) so ensure that its SvFLAGS() are 0. * Zero PL_hash_seed --- lib/ExtUtils/t/Embed.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ExtUtils') diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 7a83c98f76..9e52302bf4 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -210,6 +210,10 @@ int main(int argc, char **argv, char **env) { #ifdef PERL_GLOBAL_STRUCT free_global_struct(plvarsp); + my_plvarsp = NULL; + /* Remember, functions registered with atexit() can run after this point, + and may access "global" variables, and hence end up calling + Perl_GetVarsPrivate() */ #endif /* PERL_GLOBAL_STRUCT */ return 0; -- cgit v1.2.1