perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <>
Subject Re: [mp2] pools that go out of scope aren't a problem anymore?
Date Thu, 25 Nov 2004 21:05:20 GMT
Stas Bekman <> writes:

> which patch are you talking about Joe, the one that was committed



> Do you have any tests that clearly demonstrate the problem?

Guaranteeing a segfault may be tricky, but here are few command-line 
examples that work consistently for me:

  % ~/perl/5.8.x/bin/perl -MApache2 -MAPR::Pool -MAPR::Table -wle ' 
    my $p = APR::Pool->new; $p->cleanup_register(sub {print "Gone"}); 
    $t = APR::Table::make($p, 10) 
  }; print "Left block"; $t->set(a=>5); print $t->get("a")'

  Left block
  Segmentation fault

  % ~/perl/5.8.x/bin/perl -MApache2 -MAPR::Pool -MAPR::Table -wle '
  $t= APR::Table::make(APR::Pool->new, 10); 
  $t->set($_=>$_), print "Set $_" for 1..20'

  Segmentation fault

And as dumb luck would have it, here's what your specific
example did for me:

    % ~/perl/5.8.x/bin/perl -MApache2 -MAPR::Pool -MAPR::Table -wle '
    $t = APR::Table::make(APR::Pool->new, 10); 
    $t->set(a=>5); print "Set ok"; print $t->get("a")'

    Set ok

Joe Schaefer

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message