<?xml version="1.0" encoding="windows-1252"?>
<node id="997122" title="Re: Class::DBI explodes on mod_perl/Win32 due to Clone" created="2012-10-03 15:39:33" updated="2012-10-03 15:39:33">
<type id="11">
note</type>
<author id="725177">
GeneralElektrix</author>
<data>
<field name="doctext">
Hi,

&lt;p&gt;I need to share how I solved a similar problem with Package::Stash. Active Perl 5.10.1 Win32, mod_perl 2.0.4. It's a webapp using Template::Toolkit to render the user interface. I have the same "Free to wrong pool" message in Apache's error log.&lt;/p&gt;

&lt;p&gt;For example: &lt;code&gt;Free to wrong pool 2248d88 not 2264038 at X:/Path_to_Perl_site_lib/Package/Stash.pm line 40.&lt;/code&gt;. Each one triggered an Apache restart like this: &lt;code&gt;[notice] Parent: child process exited with status 255 -- Restarting&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After a lot of research on Google and reading obscure posts about how Apache, mod_perl and XS manage threads on Win32, I went to Stash.pm and noticed it chooses between a Pure Perl and an XS implementation around line 24:&lt;/p&gt;

&lt;code&gt;
        for my $impl ('XS', 'PP') {
            if (eval "require Package::Stash::$impl; 1;") {
                $IMPLEMENTATION = $impl;
                last;
            }
            else {
                $err .= $@;
            }
        }
&lt;/code&gt;

&lt;p&gt;I simply switched 'XS' and 'PP' around in this for loop and now it chooses the Pure Perl implementation first. Problem solved. I restarted Apache and the error log don't show the "Free to wrong pool" message anymore.&lt;/p&gt;

&lt;p&gt;Thanks to the monks who reported this problem here and helped me solve a similar issue!&lt;/p&gt;
</field>
<field name="root_node">
665353</field>
<field name="parent_node">
665353</field>
</data>
</node>
