perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: win32 bb->cleanup crashes are still there?
Date Sat, 04 Dec 2004 22:50:37 GMT
On Fri, 3 Dec 2004, Stas Bekman wrote:

> Randy, Steve, do you still have crashes with the following versions of
> TestProtocol/echo_bbs2.pm test? Philippe no longer can reproduce it.
>
> Please try the following 2 variations. Thanks!
>
> If they don't fail is it possible that it was a problem in httpd and since
> you use a newer version it just was solved in apr/httpd?
>
> package TestProtocol::echo_bbs2;
>
> # similar to TestProtocol::echo_bbs but here re-using one bucket
> # brigade for input and output, using flatten to slurp all the data in
> # the bucket brigade, and cleanup to get rid of the old buckets
>
> use strict;
> use warnings FATAL => 'all';
>
> use Apache::Connection ();
> use APR::Socket ();
> use APR::Bucket ();
> use APR::Brigade ();
> use APR::Error ();
>
> use Apache::Const -compile => qw(OK MODE_GETLINE);
> use APR::Const    -compile => qw(SUCCESS EOF SO_NONBLOCK);
>
> sub handler {
>      my $c = shift;
>
>      # starting from Apache 2.0.49 several platforms require you to set
>      # the socket to a blocking IO mode
>      $c->client_socket->opt_set(APR::SO_NONBLOCK, 0);
>
>      my $bb_in  = APR::Brigade->new($c->pool, $c->bucket_alloc);
>
>      my $last = 0;
>      while (1) {
>          my $bb_out = APR::Brigade->new($c->pool, $c->bucket_alloc);
>
>          my $rc = $c->input_filters->get_brigade($bb_in,
>                                                  Apache::MODE_GETLINE);
>          last if $rc == APR::EOF;
>          die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
>
>          next unless $bb_in->flatten(my $data);
>          #warn "read: [$data]\n";
>          last if $data =~ /^[\r\n]+$/;
>
>          $bb_in->cleanup;
>
>          # transform data here
>          my $bucket = APR::Bucket->new(uc $data);
>          $bb_out->insert_tail($bucket);
>
>          $c->output_filters->fflush($bb_out);
>
>          # XXX: add DESTROY and remove explicit calls
>          $bb_out->destroy;
>      }
>
>      $bb_in->destroy;
>      Apache::OK;
> }
>
> 1;

Hi Stas,
   This one crashes for me, after subtest 1. it's an access
violation in libaprutil.lib - after calling it up in the
debugger, tests 2 and 3 run, but fail ("HELLO" and "WORLD"
are expected, but nothing is received).
   I'll look at this further ...

> and one more:
>
> package TestProtocol::echo_bbs2;
>
> # similar to TestProtocol::echo_bbs but here re-using one bucket
> # brigade for input and output, using flatten to slurp all the data in
> # the bucket brigade, and cleanup to get rid of the old buckets
>
> use strict;
> use warnings FATAL => 'all';
>
> use Apache::Connection ();
> use APR::Socket ();
> use APR::Bucket ();
> use APR::Brigade ();
> use APR::Error ();
>
> use Apache::Const -compile => qw(OK MODE_GETLINE);
> use APR::Const    -compile => qw(SUCCESS EOF SO_NONBLOCK);
>
> sub handler {
>      my $c = shift;
>
>      # starting from Apache 2.0.49 several platforms require you to set
>      # the socket to a blocking IO mode
>      $c->client_socket->opt_set(APR::SO_NONBLOCK, 0);
>
>      my $bb_in  = APR::Brigade->new($c->pool, $c->bucket_alloc);
>      my $bb_out = APR::Brigade->new($c->pool, $c->bucket_alloc);
>
>      my $last = 0;
>      while (1) {
>          my $rc = $c->input_filters->get_brigade($bb_in,
>                                                  Apache::MODE_GETLINE);
>          last if $rc == APR::EOF;
>          die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
>
>          next unless $bb_in->flatten(my $data);
>          #warn "read: [$data]\n";
>          last if $data =~ /^[\r\n]+$/;
>
>          # transform data here
>          my $bucket = APR::Bucket->new(uc $data);
>          $bb_out->insert_tail($bucket);
>
>          $c->output_filters->fflush($bb_out);
>
>          $bb_in->cleanup;
>          $bb_out->cleanup;
>      }
>
>      # XXX: add DESTROY and remove explicit calls
>      $bb_in->destroy;
>      $bb_out->destroy;
>
>      Apache::OK;
> }
>
> 1;

This one doesn't crash, but again tests 2 and 3 fail -
"HELLO" and "WORLD" are expected, but nothing is received
(ie, an empty string).

This is with perl-5.8.4 and Apache/2.0.52, with today's
svn mp2.

-- 
best regards,
randy

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


Mime
View raw message