Skip to content

Commit

Permalink
fix segv for psudofork duping of SAVEt_GP_ALIASED_SV
Browse files Browse the repository at this point in the history
op/fork.t test 6 that contains "@A = (1..3);" will crash on Win32 with
special debugging heap and race condition rarely crash otherwise.
Refcnt mistake is from commit ff2a62e . See perl #40565 for details.
  • Loading branch information
bulk88 authored and Father Chrysostomos committed Dec 1, 2014
1 parent a2d725a commit 64c909d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sv.c
Expand Up @@ -14207,11 +14207,13 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
ptr = POPPTR(ss,ix);
TOPPTR(nss,ix) = parser_dup((const yy_parser*)ptr, param);
break;
case SAVEt_GP_ALIASED_SV:
ptr = POPPTR(ss,ix);
TOPPTR(nss,ix) = gp_dup((GP *)ptr, param);
((GP *)ptr)->gp_refcnt++;
case SAVEt_GP_ALIASED_SV: {
GP * gp_ptr = POPPTR(ss,ix);
GP * new_gp_ptr = gp_dup(gp_ptr, param);
TOPPTR(nss,ix) = new_gp_ptr;
new_gp_ptr->gp_refcnt++;
break;
}
default:
Perl_croak(aTHX_
"panic: ss_dup inconsistency (%"IVdf")", (IV) type);
Expand Down

0 comments on commit 64c909d

Please sign in to comment.