Philip M. Gollucci wrote:

Cool.  I just posted rc2 in the usual place

   http://people.apache.org/~joes/libapreq2-2.06-dev.rc2.tar.gz

cd perl/glue
./t/TEST t/request.t

t/logs/error_log
[snip]
Attempt to free temp prematurely: SV 0x8349cf4.
[Wed Jul 13 03:12:01 2005] [error] [client 127.0.0.1] Attempt to free unreferenced scalar: SV 0x8349cf4 at /usr/local/dev/src/libapreq2-2.06-dev/glue/perl/t/response/TestApReq/request.pm line 118

The above is from tests 14 causing it and 15-18 to fail.

The below(also attached) patch fixes this. The reason is that Perl_load_module() "magically frees" the two SVs; notably pkg_name.

With this patch, _ALL_ tests pass on
        FreeBSD 6.x-current/i386
        perl 5.8.7 no ithreads
        httpd 2.0.54/prefork apr not threaded
        libapreq=2.0.6-dev-rc2

I'll have some "documentation generation" feedback tomorrowish.

[EMAIL PROTECTED] /usr/local/dev/repos/ASF/httpd/apreq/trunk/glue/perl/xsbuilder>svn diff
Index: apreq_xs_postperl.h
===================================================================
--- apreq_xs_postperl.h (revision 216120)
+++ apreq_xs_postperl.h (working copy)
@@ -243,7 +243,7 @@

     stash = gv_stashpv(ERROR_CLASS, FALSE);
     if (stash == NULL) {
-        SV *pkg_name = sv_2mortal(newSVpv(class, 0));
+        SV *pkg_name = newSVpv(class, 0);
         Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, pkg_name, Nullsv);
         stash = gv_stashpv(class, TRUE);
     }


--
END
------------------------------------------------------------
    What doesn't kill us can only make us stronger.
                Nothing is impossible.
                                
Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
       http://www.liquidation.com
       http://www.uksurplus.com
       http://www.govliquidation.com
       http://www.gowholesale.com

Index: apreq_xs_postperl.h
===================================================================
--- apreq_xs_postperl.h (revision 216120)
+++ apreq_xs_postperl.h (working copy)
@@ -243,7 +243,7 @@
 
     stash = gv_stashpv(ERROR_CLASS, FALSE);
     if (stash == NULL) {
-        SV *pkg_name = sv_2mortal(newSVpv(class, 0));
+        SV *pkg_name = newSVpv(class, 0);
         Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, pkg_name, Nullsv);
         stash = gv_stashpv(class, TRUE);
     }

Reply via email to