diff options
author | David Mitchell <davem@iabyn.com> | 2011-06-06 19:09:31 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-06-06 19:44:35 +0100 |
commit | f144f1e3c6a65ce611177737a21b1166f07ef373 (patch) | |
tree | 598314e72d78bb9a268a7e0443575b75e37594c7 /pp_ctl.c | |
parent | 50f626ad600f0bdc3dd1e79057149c3dca9e2f45 (diff) | |
download | perl-f144f1e3c6a65ce611177737a21b1166f07ef373.tar.gz |
[perl #90006] out of memory during thread clone
If you run out of memory during thread cloning, exit() may be called which
will unwind the context stacks, and be very unhappy if there aren't any.
Which there might not be if we haven't allocated any yet during cloning.
We can't just fix this by creating them earlier during the cloning
sequence, because creating them requires calling malloc(), which
may fail and exit...
So just check for this condition during stack unwind.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1577,6 +1577,9 @@ Perl_dounwind(pTHX_ I32 cxix) dVAR; I32 optype; + if (!PL_curstackinfo) /* can happen if die during thread cloning */ + return; + while (cxstack_ix > cxix) { SV *sv; register PERL_CONTEXT *cx = &cxstack[cxstack_ix]; |