undefined symbol modperl_xs_sv2request_rec
am 03.02.2011 07:28:29 von Mark Hedges
A change in Module::Build recently brought it in line with
the behavior of ExtUtils::MakeMaker, which caused an error
to crop up in test cases:
# Error: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto /APR/Request/Apache2/Apache2.so' for module APR::Request::Apache2: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ APR/Request/Apache2/Apache2.so: undefined symbol: modperl_xs_sv2request_rec at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
# at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Apach e2/Request.pm line 3
# Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Apach e2/Request.pm line 3.
# BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Apach e2/Request.pm line 3.
.... but only with `Build test` and not `prove -r t/`.
This is because $ENV{PERL_DL_NONLAZY} is now always set by
Module::Build::Base when running the test suite, which makes
it try to resolve all undefined symbols.
This only seems to happen in the test script trying to 'require'
packages that use Apache2::Request (libapreq2) but people seem
inclined to think it is a problem with mod_perl and not apreq.
Any ideas? Thanks. --mark--
---------- Forwarded message ----------
Date: Thu, 3 Feb 2011 01:02:16 -0500
From: Michael G Schwern via RT
To: MARKLE@cpan.org
Subject: Re: [rt.cpan.org #65382]
If that fixes it then you're likely papering over an error.
perlrun explains PERL_DL_NONLAZY and why you'd set it to true for tests.
PERL_DL_NONLAZY
Set to one to have perl resolve all undefined symbols when
it loads a dynamic library. The default behaviour is to
resolve symbols when they are used. Setting this variable
is useful during testing of extensions as it ensures that
you get an error on misspelled function names even if the
test suite doesn't call it.
So the test is trying to tell you that modperl_xs_sv2request_rec is not
defined in your shared library.
Also, `prove -I blib` is not correct. You want `prove -b` which will pull in
blib/lib and blib/arch.
On 2011.2.3 9:08 AM, Mark Hedges via RT wrote:
> It looks like this is the problem, or at least, this fixes it for me.
> Why does do_tests() need to explicitly set this? --m--
>
> --- /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm.orig 2011-02-02
> 15:04:07.000000000 -0800
> +++ /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm 2011-02-02
> 15:07:21.000000000 -0800
> @@ -2667,8 +2667,6 @@
>
> my $tests = $self->find_test_files;
>
> - local $ENV{PERL_DL_NONLAZY} = 1;
> -
> if(@$tests) {
> my $args = $self->tap_harness_args;
> if($self->use_tap_harness or ($args and %$args)) {
--
10. Not allowed to purchase anyone's soul on government time.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/
Re: undefined symbol modperl_xs_sv2request_rec
am 03.02.2011 08:25:30 von Mark Hedges
On Wed, 2 Feb 2011, Mark Hedges wrote:
>
> A change in Module::Build recently brought it in line with
> the behavior of ExtUtils::MakeMaker, which caused an error
> to crop up in test cases:
>
> # Error: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto /APR/Request/Apache2/Apache2.so' for module APR::Request::Apache2: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/ APR/Request/Apache2/Apache2.so: undefined symbol: modperl_xs_sv2request_rec at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
BTW mod_perl 2.0.4 6.el5, perl 5.8.8 32.el5_5.2 CentOS --m--
Re: undefined symbol modperl_xs_sv2request_rec
am 05.02.2011 02:33:14 von Fred Moyer
Can you post the code and the httpd conf?
On Wed, Feb 2, 2011 at 10:28 PM, Mark Hedges wrote:
>
> A change in Module::Build recently brought it in line with
> the behavior of ExtUtils::MakeMaker, which caused an error
> to crop up in test cases:
>
> # Error: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-mul=
ti/auto/APR/Request/Apache2/Apache2.so' for module APR::Request::Apache2: /=
usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/A PR/Request/Apac=
he2/Apache2.so: undefined symbol: modperl_xs_sv2request_rec at /usr/lib/per=
l5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
> # at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Apach e2/Reque=
st.pm line 3
> # Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/i386-li=
nux-thread-multi/Apache2/Request.pm line 3.
> # BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/i38=
6-linux-thread-multi/Apache2/Request.pm line 3.
>
> ... but only with `Build test` and not `prove -r t/`.
>
> This is because $ENV{PERL_DL_NONLAZY} is now always set by
> Module::Build::Base when running the test suite, which makes
> it try to resolve all undefined symbols.
>
> This only seems to happen in the test script trying to 'require'
> packages that use Apache2::Request (libapreq2) but people seem
> inclined to think it is a problem with mod_perl and not apreq.
>
> Any ideas? =A0Thanks. =A0--mark--
>
>
> ---------- Forwarded message ----------
> Date: Thu, 3 Feb 2011 01:02:16 -0500
> From: Michael G Schwern via RT
> To: MARKLE@cpan.org
> Subject: Re: [rt.cpan.org #65382]
>
>
>
> If that fixes it then you're likely papering over an error.
>
> perlrun explains PERL_DL_NONLAZY and why you'd set it to true for tests.
>
> =A0 =A0 =A0 PERL_DL_NONLAZY
> =A0 =A0 =A0 =A0 Set to one to have perl resolve all undefined symbols whe=
n
> =A0 =A0 =A0 =A0 it loads a dynamic library. =A0The default behaviour is t=
o
> =A0 =A0 =A0 =A0 resolve symbols when they are used. =A0Setting this varia=
ble
> =A0 =A0 =A0 =A0 is useful during testing of extensions as it ensures that
> =A0 =A0 =A0 =A0 you get an error on misspelled function names even if the
> =A0 =A0 =A0 =A0 test suite doesn't call it.
>
> So the test is trying to tell you that modperl_xs_sv2request_rec is not
> defined in your shared library.
>
> Also, `prove -I blib` is not correct. =A0You want `prove -b` which will p=
ull in
> blib/lib and blib/arch.
>
>
> On 2011.2.3 9:08 AM, Mark Hedges via RT wrote:
>> It looks like this is the problem, or at least, this fixes it for me.
>> Why does do_tests() need to explicitly set this? =A0--m--
>>
>> --- /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm.orig =A02011-02-=
02
>> 15:04:07.000000000 -0800
>> +++ /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm =A0 =A0 =A0 2011=
-02-02
>> 15:07:21.000000000 -0800
>> @@ -2667,8 +2667,6 @@
>>
>> =A0 =A0my $tests =3D $self->find_test_files;
>>
>> - =A0local $ENV{PERL_DL_NONLAZY} =3D 1;
>> -
>> =A0 =A0if(@$tests) {
>> =A0 =A0 =A0my $args =3D $self->tap_harness_args;
>> =A0 =A0 =A0if($self->use_tap_harness or ($args and %$args)) {
>
>
>
> --
> 10. Not allowed to purchase anyone's soul on government time.
> =A0 =A0-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Ar=
my
> =A0 =A0 =A0 =A0 =A0 http://skippyslist.com/list/
>
>