greenrob has asked for the wisdom of the Perl Monks concerning the following question:

I was trying to run some code usign Parallel:ForkManager but come to the error message "Free to wrong pool 2227b8 not 3d5a2aa0 at C:/Perl/lib/XSLoader.pm line -1."
Not sure if anyone see this before and have this fixed ?
I am running Perl v5.8.8 built for MSWin32-x86-multi-thread on WinXP SP2
below are the code snippet
use LWP::Simple; use Parallel::ForkManager; ... @links=( ["http://www.foo.bar/rulez.data","rulez_data.txt"], ["http://new.host/more_data.doc","more_data.doc"], ... ); ... # Max 30 processes for parallel download my $pm = new Parallel::ForkManager(30); foreach my $linkarray (@links) { $pm->start and next; # do the fork my ($link,$fn) = @$linkarray; warn "Cannot get $fn from $link" if getstore($link,$fn) != RC_OK; $pm->finish; # do the exit in the child process } $pm->wait_all_children;

2006-07-16 Retitled by planetscape, as per Monastery guidelines

( keep:0 edit:8 reap:0 )

Original title: 'Free to wrong pool 2227b8 not 3d5a2aa0'

  • Comment on error message "Free to wrong pool 2227b8 not 3d5a2aa0" being returned
  • Download Code

Replies are listed 'Best First'.
Re: error message "Free to wrong pool 2227b8 not 3d5a2aa0" being returned
by Corion (Patriarch) on Jul 14, 2006 at 08:33 UTC

    The fork() emulation on Win32 is very spotty at best. Most likely, you are accessing some https:// URLs or maybe the interaction with filehandles doesn't work out the way you wish.

    You can try to move to threads on Win32, as there is active work on the threads while the fork emulation has been left as is for a long time already. Maybe you can also use some other IPC scheme to push interaction and/or memory access into the children (emulated threads) and out of the "main" program. Maybe instead of handling/modifying references and "shared" structures into the main program in the children create copies of these and handle them in the children.

Re: error message "Free to wrong pool 2227b8 not 3d5a2aa0" being returned
by jdhedden (Deacon) on Jul 15, 2006 at 01:34 UTC
    I was not able to reproduce your error. I tried the following code with ActivePerl 5.8.8 on WinXP SP2, and it ran without any errors or warnings:
    use LWP::Simple; use Parallel::ForkManager; @links=( ["http://feeds.feedburner.com/Evolution101.xml","evo.xml"], ["http://feeds.wnyc.org/radiolab.xml","rl.xml"], ); my $pm = new Parallel::ForkManager(30); foreach my $linkarray (@links) { $pm->start and next; my ($link, $fn) = @$linkarray; if (getstore($link,$fn) != RC_OK) { warn "Cannot get $fn from $link" } $pm->finish; } $pm->wait_all_children;

    Remember: There's always one more bug.
        First I'll have to apologise for the code snippet because it just serve as sample. My real code was trying to do the same thing on an array of 100,000 items and such, the loop will be running for 100K+ times.

        Also, the problem is that this error pops up randomly -- sometime it happen at loop 400, 300 etc...

        Another thing is that I tried this on 3 PC and seems that 2 of them are working fine.

        This really puzzled me. And yeas, I am using the latest perl libwww as I had discovered about the HTTP::Header.pm sort bug before before submitting question here.

        I'll be trynig to run it on Linux platform to see if this problem exist. Anyway I just ran into another problem now -- cannot fork resource temporary unavailable. Man this parallel thing is really killing me. I'll try to see if I can resolve them before posting for help again ...

        Thanks for all the response !