perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: $bb->cleanup segfaults? gozer?
Date Fri, 03 Dec 2004 15:56:33 GMT
Philippe M. Chiasson wrote:
> Stas Bekman wrote:
> 
>> Philippe? What's up with this todo/release item?
>>
>> * $bb->cleanup segfaults (originally in TestProtocol::echo_bbs2
>>    
>> http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=108967266419527&w=2
>>    owner: gozer
>>
>> Can I somehow take over it? (requires that I'll be able to reproduce 
>> the problem, which back then I didn't manage).
> 
> 
> You sure can take it over, or if you can't reproduce it, just post a 
> patch to
> revert it to the version of the test that _was_ failing and I'll have a 
> look.
> 
> I am quite busy this week, but I should be able to have a look at it and 
> see if
> it still fails on my systems.

I can't reproduce it. Here is an updated version

Index: t/protocol/TestProtocol/echo_bbs2.pm
===================================================================
--- t/protocol/TestProtocol/echo_bbs2.pm        (revision 109678)
+++ t/protocol/TestProtocol/echo_bbs2.pm        (working copy)
@@ -1,3 +1,4 @@
+
  package TestProtocol::echo_bbs2;

  # similar to TestProtocol::echo_bbs but here re-using one bucket
@@ -4,11 +5,6 @@
  # 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

-# XXX: ideally $bb->cleanup should be used here and no create/destroy
-# bb every time the loop is entered should be done. But it segfaults
-# on certain setups:
-# http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=108967266419527&w=2
-
  use strict;
  use warnings FATAL => 'all';

@@ -28,11 +24,11 @@
      # 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 $bb_in  = APR::Brigade->new($c->pool, $c->bucket_alloc);
-        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;
@@ -48,11 +44,14 @@

          $c->output_filters->fflush($bb_out);

-        # XXX: add DESTROY and remove explicit calls
-        $bb_in->destroy;
-        $bb_out->destroy;
+        $bb_in->cleanup;
+        $bb_out->cleanup;
      }

+    # XXX: add DESTROY and remove explicit calls
+    $bb_in->destroy;
+    $bb_out->destroy;
+
      Apache::OK;
  }


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