You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2004/08/05 20:45:46 UTC
apr core dumps with 2.1
hi...
the mod_perl tests currently dump core dump with httpd 2.1/APR 1.0. I spent
the better part of the morning trying to figure out why, but I can't quite
see it.
the first failing test is t/apr-ext/bucket.t which gives the below output.
the core dump yields nothing useful (just a bunch of 0x00a9411b in ?? lines
in the backtrace).
some debugging makes me think that apr_off_t is the issue - when I print
bucket->length from modperl_bucket_sv_make (after the code sets
bucket->type) I get the second entry in modperl_bucket_sv_type (currently 4,
but whatever I set it to). so my guess is that the size of some struct is
being miscalculated someplace, but I'll be darned if I can see where.
anyway, I suppose this isn't really an httpd 2.1 issue - since APR 1.0
candidates are floating around we should probably make sure we support it
(eventually).
--Geoff
t/apr-ext/bucket....1..11
# Running under perl version 5.008005 for linux
# Current time local: Thu Aug 5 08:35:47 2004
# Current time GMT: Thu Aug 5 15:35:47 2004
# Using Test.pm version 1.25
# Using Apache/Test.pm version 1.13
# $b is defined
ok 1
# $b ISA APR::Bucket object
ok 2
# testing : type
# expected: mod_perl SV bucket
# received: mod_perl SV bucket
ok 3
# testing : modperl b->length
# expected: 6
# received: 0
not ok 4
# Failed test 4 in /src/mod_perl-2.0/t/lib/TestAPRlib/bucket.pm at line 34
dubious
Test returned status 0 (wstat 139, 0x8b)
test program seems to have generated a core
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: apr core dumps with 2.1
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>Are you sure that httpd_version_as_int is the right method to decide
>>which apr is used?
>
>
> nope, and now that you mention it, it certainly assumes you got apr from httpd.
>
>
>>Is there a better way?
>
>
> I can't think of one, but I obviously don't have my apr chops lately. but
> you're right, we should make it apr-specific and not httpd-specific if at
> all possible.
ask apr-dev?
>>+1,
>>
>>but after you commit we need to refactor the obvious dups (4 in your
>>patch):
>
>
> ok, commit first then refactor.
go ahead :)
>>into one place, preferrably in Apache::Build, e.g. so that they are
>>callable as:
>>
>>$build->apr_util
>>$build->apu_util
>
>
> $build->apr_config and $build->apu_config? that is, if the call is supposed
> to return the path to tbe binary.
yes, but apr_config is confusing, since it suggest a config object, may be:
$build->apr_config_exec, or apr_config_util, or apr_config_path?
>>If you don't have the time, commit your patch and I'll refactor it next.
>>I want to do some extra refactoring on the libs stuff.
>
>
> if you have a clear picture of what you want the refactoring to look like,
> I'll just let you handle it after we get it working again. if you don't
> care, I'll give it a whirl.
I'll handle that once you have committed that one.
--
__________________________________________________________________
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
Re: apr core dumps with 2.1
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Are you sure that httpd_version_as_int is the right method to decide
> which apr is used?
nope, and now that you mention it, it certainly assumes you got apr from httpd.
> Is there a better way?
I can't think of one, but I obviously don't have my apr chops lately. but
you're right, we should make it apr-specific and not httpd-specific if at
all possible.
>
> +1,
>
> but after you commit we need to refactor the obvious dups (4 in your
> patch):
ok, commit first then refactor.
> into one place, preferrably in Apache::Build, e.g. so that they are
> callable as:
>
> $build->apr_util
> $build->apu_util
$build->apr_config and $build->apu_config? that is, if the call is supposed
to return the path to tbe binary.
> If you don't have the time, commit your patch and I'll refactor it next.
> I want to do some extra refactoring on the libs stuff.
if you have a clear picture of what you want the refactoring to look like,
I'll just let you handle it after we get it working again. if you don't
care, I'll give it a whirl.
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: apr core dumps with 2.1
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>
> Joe Schaefer wrote:
>
>>Geoffrey Young <ge...@modperlcookbook.org> writes:
>>
>>
>>
>>>hi...
>>>
>>>the mod_perl tests currently dump core dump with httpd 2.1/APR 1.0. I spent
>>>the better part of the morning trying to figure out why, but I can't quite
>>>see it.
>>
>>
>>Err, apxs was recently patched to use(supply?) the new ap[ru]-1-config.
>>You're probably linking against the wrong apr library if mp2 is still
>>relying on the "ap[ru]-config" script names.
>
>
> blarg. thanks joe!
>
> the attached patch seems to help, but I haven't had the chance to fully test
> it yet - I'll report back tomorrow if my nightly builds are successful.
Are you sure that httpd_version_as_int is the right method to decide
which apr is used? Is there a better way?
+1,
but after you commit we need to refactor the obvious dups (4 in your patch):
> + my @configs = $build->httpd_version_as_int =~ m/21\d+/
> + ? qw(apr-1 apu-1)
> + : qw(apr apu);
into one place, preferrably in Apache::Build, e.g. so that they are
callable as:
$build->apr_util
$build->apu_util
I'd fold in the other dup we have all over (e.g. in your patch)
my $ext = WIN32 ? '.bat' : '';
...
- map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);
+ map { qq{$apr_bindir/$_-config$ext} } @configs;
so that the above wrappers deal with giving you the full path and
extension. so instead of writing:
+ my @configs = $build->httpd_version_as_int =~ m/21\d+/
+ ? qw(apr-1 apu-1)
+ : qw(apr apu);
+
if (my $apr_bindir = $build->apr_bindir()) {
my $ext = WIN32 ? '.bat' : '';
my @apr_libs = grep $_, map { -x $_ && qx{$_ --link-ld} }
- map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);
+ map { qq{$apr_bindir/$_-config$ext} } @configs;
$opt_define = '-DMP_HAVE_APR_LIBS' if @apr_libs;
}
it will be:
if (my $apr_bindir = $build->apr_bindir()) {
my @apr_libs = grep $_, map { -x $_ && qx{$_ --link-ld} }
($build->apr_util, $build->apu_util);
$opt_define = '-DMP_HAVE_APR_LIBS' if @apr_libs;
}
If you don't have the time, commit your patch and I'll refactor it next.
I want to do some extra refactoring on the libs stuff.
--
__________________________________________________________________
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
Re: apr core dumps with 2.1
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Joe Schaefer wrote:
> Geoffrey Young <ge...@modperlcookbook.org> writes:
>
>
>>hi...
>>
>>the mod_perl tests currently dump core dump with httpd 2.1/APR 1.0. I spent
>>the better part of the morning trying to figure out why, but I can't quite
>>see it.
>
>
> Err, apxs was recently patched to use(supply?) the new ap[ru]-1-config.
> You're probably linking against the wrong apr library if mp2 is still
> relying on the "ap[ru]-config" script names.
blarg. thanks joe!
the attached patch seems to help, but I haven't had the chance to fully test
it yet - I'll report back tomorrow if my nightly builds are successful.
--Geoff
Re: apr core dumps with 2.1
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Geoffrey Young <ge...@modperlcookbook.org> writes:
> hi...
>
> the mod_perl tests currently dump core dump with httpd 2.1/APR 1.0. I spent
> the better part of the morning trying to figure out why, but I can't quite
> see it.
Err, apxs was recently patched to use(supply?) the new ap[ru]-1-config.
You're probably linking against the wrong apr library if mp2 is still
relying on the "ap[ru]-config" script names.
--
Joe Schaefer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org