Any thoughts on whether I am looking in the right place
about this?  It only happens in a test script running under
Module::Build which tries to require_ok() a package that
uses Apache2::Request, not normal handlers.

Mark

---------- Forwarded message ----------
Date: Thu, 3 Feb 2011 13:06:59 -0800 (PST)
From: Mark Hedges <hed...@formdata.biz>
To: modp...@perl.apache.org
Subject: undefined symbol modperl_xs_sv2request_rec


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 that 'require_ok'.

# 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/Apache2/Request.pm 
line 3
# Compilation failed in require at 
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Apache2/Request.pm line 
3.
# BEGIN failed--compilation aborted at 
/usr/lib/perl5/site_perl/5.8.8/i386-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.

mod_perl 2.0.4 6.el5, perl 5.8.8 32.el5_5.2 CentOS

Any ideas?  Thanks.  --mark--


---------- Forwarded message ----------
Date: Thu, 3 Feb 2011 01:02:16 -0500
From: Michael G Schwern via RT <bug-module-bu...@rt.cpan.org>
To: mar...@cpan.org
Subject: Re: [rt.cpan.org #65382]

<URL: https://rt.cpan.org/Ticket/Display.html?id=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)) {


Reply via email to