Hello,

I'm trying to get the Apache2 perl modules to work properly. My system is
FreeBSD 7.2-RELEASE and I'm using perl 5.8.9. I've installed the following
from ports:

libapreq2
p5-libapreq2
mod_perl2

Upon initial testing, I noticed that with

LoadModule apreq_module libexec/apache22/mod_apreq2.so
LoadModule perl_module libexec/apache22/mod_perl.so

In the Apache configuration file, whenever I run a perl script containing
any of the Apache2 modules (Apache2::Cookie for example) it will cause the
child process to seg fault as shown here:

[Wed Oct 28 18:22:56 2009] [notice] child pid 62128 exit signal Segmentation
fault (11)

So to take Apache out of the equations I ran a simple one liner to see what
happens.

# perl -MApache2::Request -e '$req = Apache2::Request::->new();'
/libexec/ld-elf.so.1:
/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/APR/Request/Apache2/Apache2.so:
Undefined symbol "modperl_xs_sv2request_rec"

# nm
/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/APR/Request/Apache2/Apache2.so
/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/APR/Request/Apache2/Apache2.so:
                 U PL_markstack_ptr
                 U PL_stack_base
                 U PL_stack_sp
                 U PL_sv_yes
                 U Perl_croak
                 U Perl_form
                 U Perl_get_sv
                 U Perl_newSV
                 U Perl_newXS
                 U Perl_sv_2mortal
                 U Perl_sv_2pv_flags
                 U Perl_sv_derived_from
                 U Perl_sv_magic
                 U Perl_sv_setref_pv
0000000000001040 T XS_APR__Request__Apache2_handle
0000000000101518 A _DYNAMIC
0000000000101740 A _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
0000000000101720 d __CTOR_END__
0000000000101718 d __CTOR_LIST__
0000000000101730 d __DTOR_END__
0000000000101728 d __DTOR_LIST__
00000000001014e0 r __FRAME_END__
0000000000101738 d __JCR_END__
0000000000101738 d __JCR_LIST__
0000000000101800 A __bss_start
                 w __cxa_finalize@@FBSD_1.0
00000000000011f0 t __do_global_ctors_aux
0000000000000d80 t __do_global_dtors_aux
0000000000101440 d __dso_handle
0000000000101800 A _edata
0000000000101808 A _end
0000000000001218 T _fini
0000000000000c70 T _init
                 U apr_version
                 U apreq_handle_apache2
0000000000000e00 T boot_APR__Request__Apache2
0000000000101800 b completed.5039
0000000000000dd0 t frame_dummy
                 U modperl_xs_sv2request_rec
0000000000101448 d p.5037

As you can see there are a lot of undefined symbols for Apache2.so. Unless
I'm missing something, I believe this is the problem. I've attached the
makefile that was used to build libapreq2 if this is of any use. I also have
been searching for a bit on other mailing lists as well as the archives for
this one and there are a few people out there with similar issues, however,
no one seems to get a solution. Is this a known bug of some sort or am I
using the wrong compile options?

Any help is greatly appreciated.

Thanks,

Allan Feid
Unix Administrator
B.S. Network Engineering

libapreq2 Makefile
-------------------------------------------------------------------------------------------------------------------

PORTNAME=       libapreq2
PORTVERSION=    2.12
PORTREVISION=   1
CATEGORIES=     www devel
MASTER_SITES=   ${MASTER_SITE_APACHE_HTTPD}
MASTER_SITE_SUBDIR=libapreq

MAINTAINER=     s...@freebsd.org
COMMENT=        Generic Apache2 Request Library

USE_APACHE=     2.0+
USE_GMAKE=      yes
USE_LDCONFIG=   yes
USE_AUTOTOOLS=  autoconf:262 libtool:22
CONFIGURE_ARGS+=        --with-apache2-apxs=${APXS}
--with-expat=${LOCALBASE}

MAKE_ENV+=     MAKE=${GMAKE} ## MakeMaker blows it without this

PLIST_SUB=      SHLIB_MAJOR="${SHLIB_MAJOR}"

.if defined (WITH_MODPERL2)
PKGNAMEPREFIX+= p5-

P5_APREQ_DEPENDS+=
${SITE_PERL}/${PERL_ARCH}/mod_perl2.pm:${PORTSDIR}/www/mod_perl2
\

${SITE_PERL}/ExtUtils/XSBuilder:${PORTSDIR}/devel/p5-ExtUtils-XSBuilder \

${SITE_PERL}/Parse/RecDescent.pm:${PORTSDIR}/devel/p5-Parse-RecDescent
BUILD_DEPENDS+= ${P5_APREQ_DEPENDS}
RUN_DEPENDS+=   ${P5_APREQ_DEPENDS}

USE_PERL5=      yes
CONFIGURE_ARGS+=        --enable-perl-glue --with-perl=${PERL5}

MAN3PREFIX=     ${PREFIX}/lib/perl5/${PERL_VERSION}
MAN3=           APR::Request.3 \
                APR::Request::Apache2.3 \
                APR::Request::CGI.3 \
                APR::Request::Cookie.3 \
                APR::Request::Error.3 \
                APR::Request::Hook.3 \
                APR::Request::Param.3 \
                APR::Request::Parser.3 \
                Apache2::Cookie.3 \
                Apache2::Upload.3 \
                Apache2::Request.3

PLIST_SUB+=     WITH_MODPERL2=""

post-patch:
        @${PERL5} -pi -e "s!%%APACHEINCLUDEDIR%%!${APACHEINCLUDEDIR}!" \
                ${WRKSRC}/glue/perl/Makefile.PL
.else
PLIST_SUB+=     WITH_MODPERL2="@comment "
.endif

.include <bsd.port.pre.mk>

.if ${APACHE_VERSION} == 20
SHLIB_MAJOR=    9
.else
SHLIB_MAJOR=    10
.endif

.include <bsd.port.post.mk>

Reply via email to