perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hay <steve....@uk.radan.com>
Subject Re: ithreads.t again
Date Fri, 04 Feb 2005 15:04:41 GMT
Stas Bekman wrote:

>Steve Hay wrote:
>[...]
>  
>
>>One thought that I just about this stuff:  I know that Linux users have 
>>always been unable to reproduce this behaviour.  Which malloc() are you 
>>using?  I'm using Perl's malloc() now (although admittedly I was using 
>>the system malloc() before).  If you're using the system malloc() it 
>>might just be worth a try with Perl's  malloc() instead to see if it 
>>makes any difference.
>>    
>>
>
>I'll try to build one with perl's malloc over the weekend and will let you 
>know how it goes.
>
Thanks.

One other idea that might be worth looking into:  could it be something 
to do with tainting?

The reason that I suggest this is that t/filter/TestFilter/in_error.pm 
contains this:

    # cause taint problems, as there was a bug (panic: POPSTACK)
    # caused when APR/Error.pm was attempted to be loaded from
    # $r->read() when the latter was trying to croak about the failed
    # read, due to the filter returning 500
    eval { system('echo', 'hello') };

and if I comment-out that eval {} line then the failing test sequence 
(filter/in_error modules/reload perl/api perl/ithreads) now succeeds 
(with no premature frees / leaked scalars).  There was some discussion 
about the POPSTACK bug referred to above here: 
http://marc.theaimsgroup.com/?l=apache-modperl-dev&w=2&r=1&s=POPSTACK&q=b.
 
I didn't follow it all, but it seems to relate to the timing of loading 
APR::Error.  That could also be relevant, given that the warnings 
causing my ithreads crash relate to the stringification of an APR:Error 
object.  Was the APR::Error loading issue ever fully resolved?

Furthermore, here's another test sequence that fails: filter/out_str_lc 
modules/reload perl/api perl/ithreads.  Again, the filter test in that 
sequence involves tainting.  If I make the following change to remove 
the tainting:

Index: t/filter/TestFilter/out_str_lc.pm
==================================================================
--- t/filter/TestFilter/out_str_lc.pm   (revision 151330)
+++ t/filter/TestFilter/out_str_lc.pm   (working copy)
@@ -14,9 +14,9 @@

     while ($filter->read(my $buffer, 1024)) {

-        # test that read() returns tainted data
-        die "read() has returned untainted data"
-            unless TestCommon::Utils::is_tainted($buffer);
+        # untaint the data
+        $buffer =~ /^(.*)$/;
+        $buffer = $1;

         $filter->print(lc $buffer);
     }

then that test sequence now succeeds too.

- 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


Mime
View raw message