You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by peter pilsl <pi...@goldfisch.at> on 2005/01/20 00:16:43 UTC

help with mod_perl: undefined symbol: Perl_sv_2pv_flags

I use mod_perl for a very long time already. Now I installed 
apache2.0.52 and took the chance to install a new mod_perl as well.

First I tried the new 2.0RC3, then I tried 1.99.17, then 1.99.16 und 
finally 1.99.14 and all failed with the very same problem. Apache could 
not start up due to the following error:

Cannot load /usr/local/apache2/modules/mod_perl.so into server: 
/usr/local/apache2/modules/mod_perl.so: undefined symbol: Perl_sv_2pv_flags

I then copied my old 1.99.08-module (that was compiled with apache 
2.0.48) to the modules-folder and everything seems to work fine now.

But I want to use a newer version. Where should I start to look for my 
problem?
is it a perl-problem? a apache-problem? a mod_perl-problem?

I buildt mod_perl with:

perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX=/usr/local/apache2


thnx,
peter

-- 
mag. peter pilsl
goldfisch.at
IT-management
tel +43 699 1 3574035
fax +43 699 4 3574035
pilsl@goldfisch.at

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Geoffrey Young wrote:
>>I nuked everything I had that smelled like mod_perl and mod_perl fails
>>at the make test:
> 
> 
>>/usr/src/mod_perl-1.99_16/t/conf/httpd.conf:
>>Cannot load /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so into
>>server: /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so:
>>undefined symbol: Perl_sv_2pv_flags
> 
> 
> that's the wrong mod_perl.so - your httpd.conf should be picking it up from
> your mod_perl build directory.

gak, I don't know what I was thinking saying that.  it's obviously time for
the weekend :)

anyway, I tried with perl-5.8.5 and it works fine for me.  the only thing I
can suggest at this point is to look at lib/Apache/BuildConfig.pm and see
what options it is picking up.  Perl_sv_2pv_flags is defined in embed.h,
which on my 5.8.5 is in

  /perl/perl-5.8.5/lib/5.8.5/i686-linux-thread-multi/CORE/embed.h

so I grep for that base directory and find .../CORE in MODPERL_CCOPTS,
MODPERL_LDOPTS, and MODPERL_LIBPERL.

so, see what you find.  Tom might be right, you might be picking up remnants
from an old perl install or something.

HTH

--Geoff

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> I nuked everything I had that smelled like mod_perl and mod_perl fails
> at the make test:

> /usr/src/mod_perl-1.99_16/t/conf/httpd.conf:
> Cannot load /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so into
> server: /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so:
> undefined symbol: Perl_sv_2pv_flags

that's the wrong mod_perl.so - your httpd.conf should be picking it up from
your mod_perl build directory.

so, remove that mod_perl.so and you should be ok.

but that the existing mod_perl.so is used is a bug I can verify from here.
we'll take care of it.

--Geoff

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by peter pilsl <pi...@goldfisch.at>.
Geoffrey Young wrote:
> 
> if you can (like there is no mod_perl 1.0 installation you care about) I
> would remove all Apache related things in your site_lib, including
> 
>   mod_perl.pm
>   ModPerl/*
>   Apache/*
>   Apache2/*
> 
> as well as /usr/local/apache2/modules/mod_perl.so. then 'make realclean' in
> your mod_perl-1.99_16 directory and start all over again.  if 'make test'
> passes then you should be able to 'make install' and everything should be
> ok.

I nuked everything I had that smelled like mod_perl and mod_perl fails 
at the make test:


/usr/local/bin/perl -Iblib/arch/Apache2 -Iblib/lib/Apache2 \
t/TEST -clean
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl 
/usr/src/mod_perl-1.99_16/t/TEST -clean
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= 
APACHE_TEST_USER= APACHE_TEST_APXS= \
/usr/local/bin/perl -Iblib/arch/Apache2 -Iblib/lib/Apache2 \
t/TEST -bugreport -verbose=0
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl 
/usr/src/mod_perl-1.99_16/t/TEST -bugreport -verbose=0
[warning] root mode: changing the files ownership to 'nobody' (99:99)
[warning] testing whether 'nobody' is able to -rwx 
/usr/src/mod_perl-1.99_16/t
"/usr/local/bin/perl" -Mlib=/usr/src/mod_perl-1.99_16/Apache-Test/lib 
-MApache::TestRun -e 'eval { Apache::TestRun::run_root_fs_test(99, 99, 
q[/usr/src/mod_perl-1.99_16/t]) }';


[warning] result: OK
[warning] the client side drops 'root' permissions and becomes 'nobody'
/usr/local/apache2/bin/httpd -d /usr/src/mod_perl-1.99_16/t -f 
/usr/src/mod_perl-1.99_16/t/conf/httpd.conf -D APACHE2
using Apache/2.0.52 (prefork MPM)

waiting 120 seconds for server to start: .Syntax error on line 12 of 
/usr/src/mod_perl-1.99_16/t/conf/httpd.conf:
Cannot load /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so into 
server: /usr/src/mod_perl-1.99_16/src/modules/perl/mod_perl.so: 
undefined symbol: Perl_sv_2pv_flags
[  error]
server has died with status 255 (t/logs/error_log wasn't created, start 
the server in the debug mode)
make: *** [run_tests] Error 143


which is still the very same problem ...


thnx,
peter


-- 
mag. peter pilsl
goldfisch.at
IT-management
tel +43 699 1 3574035
fax +43 699 4 3574035
pilsl@goldfisch.at

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> What suprised me is that at the end it states that there are several
> versions of mod_perl-modules installed. Is this a possible cause of my
> problem?

yes, quite possibly.

> Apache::Request: -
> CGI            : 3.05
> LWP            : -
> mod_perl       : 1.9908, 1.9914, 1.9916



if you can (like there is no mod_perl 1.0 installation you care about) I
would remove all Apache related things in your site_lib, including

  mod_perl.pm
  ModPerl/*
  Apache/*
  Apache2/*

as well as /usr/local/apache2/modules/mod_perl.so. then 'make realclean' in
your mod_perl-1.99_16 directory and start all over again.  if 'make test'
passes then you should be able to 'make install' and everything should be
ok.  if it's not, check to make sure that the mod_perl.so in your
/usr/local/apache2/modules is the same as the one you'll find under your
mod_perl build directory.

sorry, I know that nuking everything and starting all over isn't exciting,
or exactly useful in terms of help, but...

--Geoff

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by Tom Schindl <to...@gmx.at>.
I could swear that there is something left off from your last 
installations see the different perl installations found on your system. 
Still this is only a wild guess you have to wait for the gurus around here.

As a sidenote I always install/compile my own perl and for my apache you 
could also do that because you don't run the latest stable release which 
is 5.8.6. Compiling perl is really not that tricky, for most things you 
can use the default values but be aware when you want to run mod-perl in 
a threaded-mpm to compile this in if you run prefork leave it out 
because a thread-save perl is slower.

Be aware to install you perl in a different location than /usr/local 
because then you'll wipe out your old install.

Tom

peter pilsl wrote:

> *** Packages of interest status:
> 
> Apache::Request: -
> CGI            : 3.05
> LWP            : -
> mod_perl       : 1.9908, 1.9914, 1.9916
> 
> 
> This report was generated by t/REPORT on Thu Jan 20 10:04:04 2005 GMT.
> 
> 


help with mod_perl: undefined symbol: Perl_sv_2pv_flags (full system report this time)

Posted by peter pilsl <pi...@goldfisch.at>.
My first problem-report yesterday did not include much useful 
information. Thnx to Tom for pointing this out, so here it comes again 
with much more information from t/REPORT
What suprised me is that at the end it states that there are several 
versions of mod_perl-modules installed. Is this a possible cause of my 
problem?

thnx,
peter




1. Problem Description:

   apache cannot start due to the following error:
   Cannot load /usr/local/apache2/modules/mod_perl.so into server: 
/usr/local/apache2/modules/mod_perl.so: undefined symbol Perl_sv_2pv_flags

  I tried with several versions from 1.99_14 to 1.99_17
  Finally I reverted to my old mod_perl 1.99_08 -module compiled for 
2.0.48 and put it to the modules-folder of my new 2.0.52 and things work 
fine, but I would prefer using a newer mod_perl-module


2. Used Components and their Configuration:

*** mod_perl version 1.9916

*** using /usr/src/mod_perl-1.99_16/lib/Apache/BuildConfig.pm

*** Makefile.PL options:
   MP_APR_LIB      => aprext
   MP_AP_PREFIX    => /usr/local/apache2
   MP_COMPAT_1X    => 1
   MP_GENERATE_XS  => 1
   MP_INST_APACHE2 => 1
   MP_LIBNAME      => mod_perl
   MP_USE_DSO      => 1
   MP_USE_STATIC   => 1


*** /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.52
Server built:   Jan 19 2005 22:39:49
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_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D HTTPD_ROOT="/usr/local/apache2"
  -D SUEXEC_BIN="/usr/local/apache2/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/usr/local/apache2/lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread -ldl
  -L/usr/local/apache2/lib -laprutil-0 -lgdbm -ldb-4.1 -lexpat



*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
   Platform:
     osname=linux, osvers=2.4.24, archname=i686-linux
     uname='linux goldfisch.at 2.4.24 #9 wed mar 10 22:29:04 cet 2004 
i686 unknown '
     config_args='-de'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
     ccversion='', gccversion='2.96 20000731 (Mandrake Linux 8.1 
2.96-0.62mdk)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
     libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.2.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: USE_LARGE_FILES
   Built under linux
   Compiled at Sep 21 2004 11:47:55
   %ENV:
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /usr/local/lib/perl5/5.8.5/i686-linux
     /usr/local/lib/perl5/5.8.5
     /usr/local/lib/perl5/site_perl/5.8.5/i686-linux
     /usr/local/lib/perl5/site_perl/5.8.5
     /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
     /usr/local/lib/perl5/site_perl/5.8.0
     /usr/local/lib/perl5/site_perl
     .

*** Packages of interest status:

Apache::Request: -
CGI            : 3.05
LWP            : -
mod_perl       : 1.9908, 1.9914, 1.9916


This report was generated by t/REPORT on Thu Jan 20 10:04:04 2005 GMT.


Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags

Posted by Tom Schindl <to...@gmx.at>.
Hi Peter,

you fail to give us the information required to solve your problem.

Please see:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

Tom

peter pilsl wrote:
> 
> I use mod_perl for a very long time already. Now I installed 
> apache2.0.52 and took the chance to install a new mod_perl as well.
> 
> First I tried the new 2.0RC3, then I tried 1.99.17, then 1.99.16 und 
> finally 1.99.14 and all failed with the very same problem. Apache could 
> not start up due to the following error:
> 
> Cannot load /usr/local/apache2/modules/mod_perl.so into server: 
> /usr/local/apache2/modules/mod_perl.so: undefined symbol: Perl_sv_2pv_flags
> 
> I then copied my old 1.99.08-module (that was compiled with apache 
> 2.0.48) to the modules-folder and everything seems to work fine now.
> 
> But I want to use a newer version. Where should I start to look for my 
> problem?
> is it a perl-problem? a apache-problem? a mod_perl-problem?
> 
> I buildt mod_perl with:
> 
> perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX=/usr/local/apache2
> 
> 
> thnx,
> peter
> 


Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags [SOLVED]

Posted by Stas Bekman <st...@stason.org>.
peter pilsl wrote:

> Ok - I finally solved the mystery.
> I had only one single libperl.so on my system in /usr/local/lib and even 
> this one was too much.
> 
> Using ldd I discovered that my new failing mod_perl.so was linked 
> against this libperl.so while my old working mod_perl.so wasnt linked 
> against any libperl.so.  So I removed this libperl.so and compiled 
> mod_perl from the scratch and everything was going fine.
> 
> So it was a leftover from a old system. Digging a bit deeper showed that 
> it was left behind by my good old perl5.6.1 :)

> I still dont understand why my new perl5.8.5 does not have a libperl.so 

because your new perl was compiled to be static:

*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
[...]
     libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a

so you have libperl.a instead.

> and why mod_perl can live very well without it. 

because it now includes the whole libperl.a archive inside mod_perl.so. 
It's a good idea to avoid that. When using libperl.so and more than one 
application is linked against it, the system loads it only once, saving 
some memory and startup time (when more than one app using that libperl.so 
is running at the same time).

But it's not too bad if it doesn't.

-- 
__________________________________________________________________
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: help with mod_perl: undefined symbol: Perl_sv_2pv_flags [SOLVED]

Posted by peter pilsl <pi...@goldfisch.at>.
Stas Bekman wrote:
> 
> 
> that normally means that you have libperl.so in /usr/lib and it's not the
> one used by the perl you've built mod_perl with. Please post the output of
> 
>   ldd /usr/local/apache2/modules/mod_perl.so
> 
> and if you have libperl.so in /usr/local/lib and /usr/lib. if you have 
> both, that's your problem. e.g. see:
> http://perl.apache.org/docs/1.0/guide/troubleshooting.html#_relocation_errors__or__undefined_symbol_ 
> 

Ok - I finally solved the mystery.
I had only one single libperl.so on my system in /usr/local/lib and even 
this one was too much.

Using ldd I discovered that my new failing mod_perl.so was linked 
against this libperl.so while my old working mod_perl.so wasnt linked 
against any libperl.so.  So I removed this libperl.so and compiled 
mod_perl from the scratch and everything was going fine.

So it was a leftover from a old system. Digging a bit deeper showed that 
it was left behind by my good old perl5.6.1 :)

I still dont understand why my new perl5.8.5 does not have a libperl.so 
and why mod_perl can live very well without it.  But sometimes even one 
is too much :)


Thnx to all for helping me out here,
peter

ps: and thnx plus a nice weekend to geoffrey if he is still reading here :)




-- 
mag. peter pilsl
goldfisch.at
IT-management
tel +43 699 1 3574035
fax +43 699 4 3574035
pilsl@goldfisch.at

Re: help with mod_perl: undefined symbol: Perl_sv_2pv_flags

Posted by Stas Bekman <st...@stason.org>.
peter pilsl wrote:
> 
> I use mod_perl for a very long time already. Now I installed 
> apache2.0.52 and took the chance to install a new mod_perl as well.
> 
> First I tried the new 2.0RC3, then I tried 1.99.17, then 1.99.16 und 
> finally 1.99.14 and all failed with the very same problem. Apache could 
> not start up due to the following error:
> 
> Cannot load /usr/local/apache2/modules/mod_perl.so into server: 
> /usr/local/apache2/modules/mod_perl.so: undefined symbol: Perl_sv_2pv_flags

that normally means that you have libperl.so in /usr/lib and it's not the
one used by the perl you've built mod_perl with. Please post the output of

   ldd /usr/local/apache2/modules/mod_perl.so

and if you have libperl.so in /usr/local/lib and /usr/lib. if you have 
both, that's your problem. e.g. see:
http://perl.apache.org/docs/1.0/guide/troubleshooting.html#_relocation_errors__or__undefined_symbol_

-- 
__________________________________________________________________
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