You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by go...@apache.org on 2006/02/04 01:13:25 UTC
svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Author: gozer
Date: Fri Feb 3 16:13:23 2006
New Revision: 374792
URL: http://svn.apache.org/viewcvs?rev=374792&view=rev
Log:
apr_table_(copy|overlay) has hierarchical requirements on the pool
being used, since it copies content from table to table without
reallocing it.
The test logic was broken and would produce these kind of aborts
when apr was compiled with -DAPR_POOL_DEBUG:
apr_table_copy: t's pool is not an ancestor of p
apr_table_overlay: overlay's pool is not an ancestor of p
apr_table_overlay: base's pool is not an ancestor of p
This reworks the test logic a bit to keep on testing what it was
testing, while passing correct pools to the various table methods
Modified:
perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Modified: perl/modperl/trunk/t/lib/TestAPRlib/table.pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/lib/TestAPRlib/table.pm?rev=374792&r1=374791&r2=374792&view=diff
==============================================================================
--- perl/modperl/trunk/t/lib/TestAPRlib/table.pm (original)
+++ perl/modperl/trunk/t/lib/TestAPRlib/table.pm Fri Feb 3 16:13:23 2006
@@ -307,11 +307,16 @@
# - copy
# - overlay
{
- my $table = APR::Table::make(APR::Pool->new, 10);
- $table->set($_ => $_) for 1..20;
- ok t_cmp $table->get(20), 20, "no segfault";
+ {
+ my $table = APR::Table::make(APR::Pool->new, 10);
+ $table->set($_ => $_) for 1..20;
+ ok t_cmp $table->get(20), 20, "no segfault";
+ }
- my $table_copy = $table->copy(APR::Pool->new);
+ my $pool = APR::Pool->new;
+ my $table = APR::Table::make($pool, 10);
+ $table->set($_ => $_) for 1..20;
+ my $table_copy = $table->copy($pool->new);
{
# verify that the temp pool used to create $table_copy was
# not freed, by allocating a new table to fill with a
@@ -325,9 +330,12 @@
}
ok t_cmp $table_copy->get(20), 20, "no segfault/valid data";
- my $table2 = APR::Table::make(APR::Pool->new, 1);
+ my $table2 = APR::Table::make($pool, 1);
$table2->set($_**2 => $_**2) for 1..20;
- my $overlay = $table_copy->overlay($table2, APR::Pool->new);
+ my $table2_copy = APR::Table::make($pool, 1);
+ $table2_copy->set($_ => $_) for 1..20;
+
+ my $overlay = $table2_copy->overlay($table2, $pool->new);
{
# see the comment for above's:
# $table_copy = $table->copy(APR::Pool->new);
Re: svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 03, 2006 at 08:32:50PM -0500, Joe Schaefer wrote:
> "Philippe M. Chiasson" <go...@ectoplasm.org> writes:
>
> > Just for the record, this change had *nothing* to do with httpd-2.2, it was
> > experienced under 2.2, but only because I built it with
> > -DAPR_POOL_DEBUG.
>
> It's actually a function of which apr library you're using.
> A while ago I submitted a patch to apr to reactivate the pool
> debug mechanism for tables, and they accepted it. I know the patch
> is in the 1.x line (which httpd-2.2 uses), not sure if it got
> backported to 0.9.x (which 2.0 uses) tho.
That patch isn't in the 0.9.x tree, no, nor is the joined-pool
implementation on which it kind of relies (I'd really rather not mess
with such stuff in 0.9.x any more unless there's strong motivation)...
joe
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Posted by Joe Schaefer <jo...@sunstarsys.com>.
"Philippe M. Chiasson" <go...@ectoplasm.org> writes:
> Just for the record, this change had *nothing* to do with httpd-2.2, it was
> experienced under 2.2, but only because I built it with
> -DAPR_POOL_DEBUG.
It's actually a function of which apr library you're using.
A while ago I submitted a patch to apr to reactivate the pool
debug mechanism for tables, and they accepted it. I know the patch
is in the 1.x line (which httpd-2.2 uses), not sure if it got
backported to 0.9.x (which 2.0 uses) tho.
--
Joe Schaefer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Philippe M. Chiasson wrote:
> Joe Schaefer wrote:
>
>>gozer@apache.org writes:
>>
>>
>>>Author: gozer
>>>Date: Fri Feb 3 16:13:23 2006
>>>New Revision: 374792
>>>
>>>URL: http://svn.apache.org/viewcvs?rev=374792&view=rev
>>>Log:
>>>apr_table_(copy|overlay) has hierarchical requirements on the pool
>>>being used, since it copies content from table to table without
>>>reallocing it.
>>>
>>>The test logic was broken and would produce these kind of aborts
>>>when apr was compiled with -DAPR_POOL_DEBUG:
>>
>>Heh, sorry I forgot to commit a similar patch.
>>Thanks gozer!
>
>
> No problem, I had some tuits lying around, and I wanted to see how things were
> with the newly released httpd-2.2.
Just for the record, this change had *nothing* to do with httpd-2.2, it was
experienced under 2.2, but only because I built it with -DAPR_POOL_DEBUG.
I suspect 2.0 would have failed the same way.
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Re: svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Joe Schaefer wrote:
> gozer@apache.org writes:
>
>>Author: gozer
>>Date: Fri Feb 3 16:13:23 2006
>>New Revision: 374792
>>
>>URL: http://svn.apache.org/viewcvs?rev=374792&view=rev
>>Log:
>>apr_table_(copy|overlay) has hierarchical requirements on the pool
>>being used, since it copies content from table to table without
>>reallocing it.
>>
>>The test logic was broken and would produce these kind of aborts
>>when apr was compiled with -DAPR_POOL_DEBUG:
>
> Heh, sorry I forgot to commit a similar patch.
> Thanks gozer!
No problem, I had some tuits lying around, and I wanted to see how things were
with the newly released httpd-2.2.
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Re: svn commit: r374792 - /perl/modperl/trunk/t/lib/TestAPRlib/table.pm
Posted by Joe Schaefer <jo...@mail.sunstarsys.com>.
gozer@apache.org writes:
> Author: gozer
> Date: Fri Feb 3 16:13:23 2006
> New Revision: 374792
>
> URL: http://svn.apache.org/viewcvs?rev=374792&view=rev
> Log:
> apr_table_(copy|overlay) has hierarchical requirements on the pool
> being used, since it copies content from table to table without
> reallocing it.
>
> The test logic was broken and would produce these kind of aborts
> when apr was compiled with -DAPR_POOL_DEBUG:
Heh, sorry I forgot to commit a similar patch.
Thanks gozer!
--
Joe Schaefer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org