add CLONEf_KEEP_PTR_TABLE to win fork emulation.
David Mitchell [Wed, 5 Aug 2009 13:20:29 +0000 (14:20 +0100)]
This keeps the ptr-table table around after the thread has been created.
This has been on for user threads for a while now, but not for
Windows forks. Turns out that Variable::Magic relies on the table still
being there, so crashes under windows forks.  This increases memory usage
per fork, but stops things crashing. Sigh.
[perl #66158]

win32/perlhost.h

index c2473c9..c02d409 100644 (file)
@@ -1836,7 +1836,8 @@ PerlProcFork(struct IPerlProc* piPerl)
     }
     h = new CPerlHost(*(CPerlHost*)w32_internal_host);
     PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX,
-                                                CLONEf_COPY_STACKS,
+                                                  CLONEf_COPY_STACKS
+                                                | CLONEf_KEEP_PTR_TABLE,
                                                 h->m_pHostperlMem,
                                                 h->m_pHostperlMemShared,
                                                 h->m_pHostperlMemParse,