in reply to Perl forking and shared memory strangeness under Windows

In my case, (Win XP, perl 5.8.0, MMF 0.09), perl crashes regardless of whether or not the line is commented.

The crash is at 77C43038 in msvcrt.dll, which is called from Storable.dll!00335423() . Hopefully, that will clue the author of the dll (Roger?).

"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."
  • Comment on Re: Perl forking and shared memory strangeness under Windows

Replies are listed 'Best First'.
Re: Re: Perl forking and shared memory strangeness under Windows
by Roger (Parson) on Feb 23, 2004 at 06:09 UTC
    Thanks NetWallah for the debug information, now I have something to start with.

    I changed the tie() variable to a simple scalar, so that it will be go through shareable, and tested again, the following code, almost exactly the same as before, works with no problems. So I guess the problem is really in Shareable.
    #!C:/Perl/bin/perl -w use strict; use Win32::MMF; use Win32::MMF::Shareable; if( fork ) { my $ns = tie( my $share, 'Win32::MMF::Shareable', 'share' ) || die; sleep(1); $share = 'PARENT'; } else { my $ns = tie( my $share, 'Win32::MMF::Shareable', 'share' ) || die; $share = 'CHILD'; }

    Now the question comes down to why Storable is causing Perl to crash? Is the Storable module thread safe? Is there a thread safe alternative?

    Update:
    I have tried BrowserUk's suggestion and the problem seems to have gone away. I am currently investigating on why having require in each process after fork cures the problem.