This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #90006] cloning crashes during Out of Memory
authorDavid Mitchell <davem@iabyn.com>
Mon, 6 Jun 2011 16:15:09 +0000 (17:15 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 6 Jun 2011 18:44:35 +0000 (19:44 +0100)
commit50f626ad600f0bdc3dd1e79057149c3dca9e2f45
tree211757efc2dadb5e0e04aa627f7f817555c8e0cc
parent692fcd37585c5b7f1e0e1a30148e0451f2f963eb
[perl #90006] cloning crashes during Out of Memory

Perl's malloc has a $^M facility to create an emergency memory
allocation during an Out Of Memory crisis. This requires accessing
PL_defstash. In perl_clone_using(), in debugging builds, the Idefstash
field was intially poisoned, and before it had a chance to be properly
initialised, malloc() may have been called.

Fix this by initialising PL_defstash to NULL early on.
sv.c