mod_perl2 bug report

mod_perl2 bug report

am 16.08.2005 12:27:15 von Alexander Smotrov

1. Problem Description:

I'm trying to install mod_perl2, but i've got a problem.

I've successfully compiled apache 2.054, mod_perl2, and the next step
is running 'make test' command into for mod_perl.

During the tests i've an error:

/home/asm/apache2054/bin/bin/httpd -d /usr/home/asm/soft/Apache/mod_perl-2.0.1/t -f /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.0.54 (prefork MPM)

waiting 120 seconds for server to start: .Syntax error on line 12 of /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf:
Cannot load /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so into server: /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so: Undefined symbol "apr_os_thread_current"


Could you help me to solve this problem ?


2. Used Components and their Configuration:

*** mod_perl version 2.000001

*** using /usr/home/asm/soft/Apache/mod_perl-2.0.1/lib/Apache2/BuildCo nfig.pm

*** Makefile.PL options:
MP_APR_LIB => aprext
MP_APXS => /usr/home/asm/apache2054/bin/bin/apxs
MP_COMPAT_1X => 1
MP_DEBUG => 1
MP_GENERATE_XS => 1
MP_LIBNAME => mod_perl
MP_TRACE => 1
MP_USE_DSO => 1


*** /home/asm/apache2054/bin/bin/httpd -V
Server version: Apache/2.0.54
Server built: Aug 16 2005 14:11:55
Server's Module Magic Number: 20020903:9
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/home/asm/apache2054"
-D SUEXEC_BIN="/home/asm/apache2054/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"


*** (apr|apu)-config linking info

-L/home/asm/apache2054/bin/lib -laprutil-0 -ldb4 -lexpat
-L/home/asm/apache2054/bin/lib -lapr-0 -lm -lcrypt



*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=freebsd, osvers=4.7-release, archname=i386-freebsd-thread-multi-64int
uname='freebsd sspserver.dev 4.7-release freebsd 4.7-release #3: mon jun 2 17:20:39 msd 2003 root@sspserver.dev:usrsrcsyscompilesmp i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include',
optimize='-O3',
cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.2', gccosandvers='freebsd4.7'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags ='-pthread -Wl,-E -L/usr/local/lib'
libpth=/home/blackcat/gcc/lib /usr/lib /usr/local/lib
libs=-lm -lcrypt -lutil -lc_r
perllibs=-lm -lcrypt -lutil -lc_r
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under freebsd
Compiled at Dec 5 2003 17:22:48
%ENV:
PERL_LWP_USE_HTTP_10="1"
@INC:
/usr/local/lib/perl5/5.8.2/i386-freebsd-thread-multi-64int
/usr/local/lib/perl5/5.8.2
/usr/local/lib/perl5/site_perl/5.8.2/i386-freebsd-thread-mul ti-64int
/usr/local/lib/perl5/site_perl/5.8.2
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl/5.8
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl
.

*** Packages of interest status:

Apache2 : -
Apache2::Request : -
CGI : 3.06
ExtUtils::MakeMaker: 6.21
LWP : 5.76, 5.76
mod_perl : -
mod_perl2 : 2.000001


3. This is the core dump trace: (if you get a core dump):

[CORE TRACE COMES HERE]

This report was generated by t/REPORT on Tue Aug 16 10:23:59 2005 GMT.

-------------8<---------- End Bug Report --------------8<----------

Re: mod_perl2 bug report

am 17.08.2005 00:43:46 von pgollucci

> During the tests i've an error:
>
> /home/asm/apache2054/bin/bin/httpd -d /usr/home/asm/soft/Apache/mod_perl-2.0.1/t -f /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
> using Apache/2.0.54 (prefork MPM)
>
> waiting 120 seconds for server to start: .Syntax error on line 12 of /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf:
> Cannot load /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so into server: /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so: Undefined symbol "apr_os_thread_current"
> *** /usr/local/bin/perl -V
> Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
> Platform:
> osname=freebsd, osvers=4.7-release, archname=i386-freebsd-thread-multi-64int
> uname='freebsd sspserver.dev 4.7-release freebsd 4.7-release #3: mon jun 2 17:20:39 msd 2003 root@sspserver.dev:usrsrcsyscompilesmp i386 '
> config_args=''
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
> use64bitint=define use64bitall=undef uselongdouble=undef
> usemymalloc=n, bincompat5005=undef

Whats happened here is that your PERL is ithread enabled and thus
mod_perl thinks it should be too. Unfortunately, the APR library you are
linking against is not thread enabled (-lpthread or -llibc_r). BTW you
don't want the latter, use -lpthread on FreeBSD. You might need to
edit your /etc/libmap.conf file (see my previous posts on this)

A _VERY_ likely reason as I am a freebsd guy myself, is that you've
installed Subversion or some other port that installs apr. That apr is
not threaded. The apr-1-config and apu-1-config binaries are in your
path (/usr/local/bin). This causes the HTTPD build to link against the
WRONG apr/apr util libraries. Later when mod_perl2 calls apxs to get
the path for things, its given the wrong ones causing the error you see.

The easiest solution for me is to temporarily move them out of your PATH
during compilation or rename them temporarily.

I'm surprised, that you didn't get this during the mod_perl2 compile as
thats where I usually get it and smack myself.

I'm tempted to add a note to the mp2 build page about this, but don't
know exactly how to word it.



--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com

Re: mod_perl2 bug report

am 17.08.2005 01:12:51 von Stas Bekman

Philip M. Gollucci wrote:
>> During the tests i've an error:
>>
>> /home/asm/apache2054/bin/bin/httpd -d
>> /usr/home/asm/soft/Apache/mod_perl-2.0.1/t -f
>> /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf -D APACHE2
>> -D PERL_USEITHREADS
>> using Apache/2.0.54 (prefork MPM)
>>
>> waiting 120 seconds for server to start: .Syntax error on line 12 of
>> /usr/home/asm/soft/Apache/mod_perl-2.0.1/t/conf/httpd.conf:
>> Cannot load
>> /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so
>> into server:
>> /usr/home/asm/soft/Apache/mod_perl-2.0.1/src/modules/perl/mo d_perl.so:
>> Undefined symbol "apr_os_thread_current"
>> *** /usr/local/bin/perl -V
>> Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
>> Platform:
>> osname=freebsd, osvers=4.7-release,
>> archname=i386-freebsd-thread-multi-64int
>> uname='freebsd sspserver.dev 4.7-release freebsd 4.7-release #3:
>> mon jun 2 17:20:39 msd 2003 root@sspserver.dev:usrsrcsyscompilesmp i386 '
>> config_args=''
>> hint=recommended, useposix=true, d_sigaction=define
>> usethreads=define use5005threads=undef useithreads=define
>> usemultiplicity=define
>> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>> use64bitint=define use64bitall=undef uselongdouble=undef
>> usemymalloc=n, bincompat5005=undef
>
>
> Whats happened here is that your PERL is ithread enabled and thus
> mod_perl thinks it should be too. Unfortunately, the APR library you are
> linking against is not thread enabled (-lpthread or -llibc_r). BTW you
> don't want the latter, use -lpthread on FreeBSD. You might need to
> edit your /etc/libmap.conf file (see my previous posts on this)

Well, the diagnostics are not exactly correct, Philip. as the problem has
little to do with perl having ithreads enabled.

apr_os_thread_current is used only if APR_HAS_THREADS is defined. When
mod_perl is being built it gets this define from the apr headers, as
supplied by apxs. The problem happens because mod_perl finds one set of
headers during the build, but a libapr from a different install gets
loaded at run time.

But the following solution should work :)

> A _VERY_ likely reason as I am a freebsd guy myself, is that you've
> installed Subversion or some other port that installs apr. That apr is
> not threaded. The apr-1-config and apu-1-config binaries are in your
> path (/usr/local/bin). This causes the HTTPD build to link against the
> WRONG apr/apr util libraries. Later when mod_perl2 calls apxs to get
> the path for things, its given the wrong ones causing the error you see.
>
> The easiest solution for me is to temporarily move them out of your PATH
> during compilation or rename them temporarily.
>
> I'm surprised, that you didn't get this during the mod_perl2 compile as
> thats where I usually get it and smack myself.
>
> I'm tempted to add a note to the mp2 build page about this, but don't
> know exactly how to word it.




--
____________________________________________________________ ______
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

Re: mod_perl2 bug report

am 17.08.2005 01:14:52 von pgollucci

Stas Bekman wrote:
> Philip M. Gollucci wrote:
> Well, the diagnostics are not exactly correct, Philip. as the problem
> has little to do with perl having ithreads enabled.
>
> apr_os_thread_current is used only if APR_HAS_THREADS is defined. When
> mod_perl is being built it gets this define from the apr headers, as
> supplied by apxs. The problem happens because mod_perl finds one set of
> headers during the build, but a libapr from a different install gets
> loaded at run time.
I've never said that right yet. *sigh*

Thanks.

--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com