perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
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 <stas@stason.org> writes:

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

Yes.

[...]

> 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")'

  Gone
  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
    5

-- 
Joe Schaefer


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


Mime
View raw message