perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Error with t\api\slurp_filename + t\filter\in_error?
Date Thu, 08 Jul 2004 00:32:27 GMT

> I can reproduce this with prefork, running:
> t/TEST -minclients 1 t/api/slurp_filename.t t/filter/in_error.t

It's now self contained, after I've moved the -T problem eval into 
in_error itself:

Index: t/filter/TestFilter/in_error.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_error.pm,v
retrieving revision 1.3
diff -u -r1.3 in_error.pm
--- t/filter/TestFilter/in_error.pm     31 Dec 2003 19:07:26 -0000      1.3
+++ t/filter/TestFilter/in_error.pm     8 Jul 2004 00:28:50 -0000
@@ -23,7 +23,6 @@

      debug join '', "-" x 20 , " filter called ", "-" x 20;

-    t_server_log_error_is_expected();
      die "This filter must die";

      return Apache::OK;
@@ -32,10 +31,14 @@
  sub response {
      my $r = shift;

+    # 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') };
+
+    t_server_log_error_is_expected(2);
      my $len = $r->read(my $data, $r->headers_in->{'Content-Length'});
-    t_server_log_error_is_expected();
-    die "failed to read POSTed data: $!" unless defined $len;
-    debug "read $len bytes [$data]";

      $r->content_type('text/plain');
      $r->print("it shouldn't be printed, because the input filter has 
died");

I couldn't quite figure out where the wrecked OP stack problem comes 
from (the panic message comes from POPSTACK macro in cop.h), but 
breaking in that code with gdb, showed that the problem was caused by 
trying to require APR/Error.pm.

Ideally APR/Error.pm should be loaded at the server startup, but I can't 
figure out where to do that, since Apache2.pm could be loaded anywhere 
in the startup phase and we may need that module even before Apache2 is 
loaded...


-- 
__________________________________________________________________
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


Mime
View raw message