Subject: | WIN32::OLE and fork() or Thread |
Date: | Mon, 7 Jan 2008 03:50:31 -0500 |
To: | <bug-libwin32 [...] rt.cpan.org> |
From: | Copet_Eric [...] emc.com |
I suppose than the issue is related to BUG:14584
If you include Win32::OLE and you use Threads or Fork (like
Parrallel::Forkmanager) in your program, I get a message popup "The
memory could not be written" and perl crashes.
Using debugger on perl.exe, the issue occurs at line 210 of vmem.h :
*nowhere=0;
This is a Perl program to reproduce the issue, if you uncomment the use
Win32::OLE the popup is displayed and perl.exe crashes.
use Parallel::ForkManager;
use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1;
use vars qw(@ISA $VERSION $DEBUG @EXPORT );
#Please uncomment these two following line to get the issue.
#use Win32::OLE qw( in );
#use Win32::OLE::Variant;
BEGIN {
}
@links=(
[1,1],
);
# Max 30 processes for parallel download
my $pm = new Parallel::ForkManager(30);
foreach my $linkarray (@links) {
$pm->start and next; # do the fork
print "$linkarray\n";
sleep 2;
$pm->finish; # do the exit in the child process
}
$pm->wait_all_children;
exit(0);