You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Steve Hay <st...@uk.radan.com> on 2005/03/30 13:18:48 UTC

Debugging leaked scalars

Having another look at why perl/ithreads.t fails on Win32, now using 
Dave Mitchell's -DDEBUG_LEAKING_SCALARS improvement:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-03/msg00639.html

As before I find that "use warnings => 'FATAL';" in 
t/response/TestPerl/ithreads.pm causes the Apache.exe running the test 
to exit, and then all subsequent tests fails because there is no server 
running any more.  (I still haven't got round to making the test suite 
abort when this happens...)

Commenting-out that "use warnings => 'FATAL';" line allows the tests to 
proceed (and they are all successful, apart from t/error/runtime.t, 
reported separately).  So what was the warning that caused the exit?  If 
I add:

    close STDERR;
    open STDERR, '>C:\\Temp\\stderr.txt';

to the start of TestPerl::ithreads::handler() then I get the following 
output in C:\Temp\stderr.txt:

*** The following leak is expected (perl bug #34342) ***
Scalars leaked: 1
leaked: sv=0x182d3058 flags=0x084040004 refcnt=0, Perl interpreter: 
0x144bda38
    allocated at 
C:\apache2\source\mod_perl-2.0\Apache-Test\lib/Apache/Test.pm:237 by 
entersub (cloned)
leaked: sv=0x12fe43dc flags=0x0880003 refcnt=0, Perl interpreter: 0x144bda38
    allocated at -e:0 by (none) (cloned)

*** The following leak is expected (perl bug #34341) ***
Scalars leaked: 1
leaked: sv=0x140cf858 flags=0x084040004 refcnt=0, Perl interpreter: 
0x144bda38
    allocated at 
C:\apache2\source\mod_perl-2.0\Apache-Test\lib/Apache/Test.pm:237 by 
entersub (cloned)
leaked: sv=0x1247b184 flags=0x084046007 refcnt=0, Perl interpreter: 
0x144bda38
    allocated at -e:0 by (none) (cloned)

So it looks like the failure is just down to bugs that are already known 
about, and this doesn't really shed much light on anything :(

(Why does it say "Scalars leaked: 1" and then list 2 leaked sv's each 
time, though?)

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only.  If you have received this message in error or there are any problems, please notify the sender immediately.  The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden.  Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Debugging leaked scalars

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
> Having another look at why perl/ithreads.t fails on Win32, now using 
> Dave Mitchell's -DDEBUG_LEAKING_SCALARS improvement:
> 
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-03/msg00639.html
> 
> As before I find that "use warnings => 'FATAL';" in 
> t/response/TestPerl/ithreads.pm causes the Apache.exe running the test 
> to exit, and then all subsequent tests fails because there is no server 
> running any more.  (I still haven't got round to making the test suite 
> abort when this happens...)
> 
> Commenting-out that "use warnings => 'FATAL';" line allows the tests to 
> proceed (and they are all successful, apart from t/error/runtime.t, 
> reported separately).  So what was the warning that caused the exit?  If 
> I add:
> 
>     close STDERR;
>     open STDERR, '>C:\\Temp\\stderr.txt';
> 
> to the start of TestPerl::ithreads::handler() then I get the following 
> output in C:\Temp\stderr.txt:
> 
> *** The following leak is expected (perl bug #34342) ***
> Scalars leaked: 1
> leaked: sv=0x182d3058 flags=0x084040004 refcnt=0, Perl interpreter: 
> 0x144bda38
>     allocated at 
> C:\apache2\source\mod_perl-2.0\Apache-Test\lib/Apache/Test.pm:237 by 
> entersub (cloned)
> leaked: sv=0x12fe43dc flags=0x0880003 refcnt=0, Perl interpreter: 0x144bda38
>     allocated at -e:0 by (none) (cloned)
> 
> *** The following leak is expected (perl bug #34341) ***
> Scalars leaked: 1
> leaked: sv=0x140cf858 flags=0x084040004 refcnt=0, Perl interpreter: 
> 0x144bda38
>     allocated at 
> C:\apache2\source\mod_perl-2.0\Apache-Test\lib/Apache/Test.pm:237 by 
> entersub (cloned)
> leaked: sv=0x1247b184 flags=0x084046007 refcnt=0, Perl interpreter: 
> 0x144bda38
>     allocated at -e:0 by (none) (cloned)
> 
> So it looks like the failure is just down to bugs that are already known 
> about, and this doesn't really shed much light on anything :(
> 
> (Why does it say "Scalars leaked: 1" and then list 2 leaked sv's each 
> time, though?)

Have you seen the work, I've started on making the mp2 API perl-threads 
safe? I believe that the leaks are caused by some mp2 objects which aren't 
properly cloned on threads start. I'll first finish to polish the 
APR::Table and APR::Pool classes and then move on to others. Hopefully 
when it's done it'll just disappear. So we will see.





-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org