You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by William McKee <wi...@knowmad.com> on 2004/04/07 09:33:03 UTC

[mp1] Apache/mod_perl startup problems - PL_nowarn

Hi List,

I've spent the last several hours trying to figure out the following
error message that I receive with Apache 1.3.29 and mod_perl 1.29:

	/usr/local/apache/bin/httpd: relocation error:
	/usr/local/apache/bin/httpd: undefined symbol: PL_dowarn
	bin/apachectl start: httpd could not be started

This output occurs whenever I try to start the httpd that has been
compiled. There are no compilation errors. There is nothing further in
the error.log. I am compiling under Debian Sarge with gcc 3.3.3, Perl
5.8.3 and make 3.80. I have rebuilt Perl and tried to reinstall as many
of the modules as I could. The system is a dual cpu and I did not do
anything special when recompiling Perl.

I've completely read the short and long installation notes and searched
the archives but could not a solution to my problem. I did try locating
the PL_nowarn symbol via the following command:

	nm ../apache_1.3.29/src/httpd | grep PL_nowarn

This returned nothing which seems suspicious.

Trying to run the 'make test' operation which uses a simplified
httpd.conf fails with the message above. Simply trying
'../apache_1.3.29/src/httpd -v' also fails with the same message. I can
successfully build Apache without mod_perl. Most of my test Perl scripts
are working fine from the command line.

perl -V output:
  Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
    Platform:
      osname=linux, osvers=2.4.25, archname=i686-linux
      uname='linux webserv 2.4.25 #1 smp tue apr 6 12:23:14 edt 2004 i686
  gnulinux '
      config_args='-Dotherlibdirs=/usr/share/perl5/ -des'
      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 -I/usr/local/include
  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
      optimize='-O3',
      cppflags='-fno-strict-aliasing -I/usr/local/include'
      ccversion='', gccversion='3.3.3 (Debian)', 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 -lgdbm -ldl -lm -lcrypt -lutil -lc
      perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
      libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
      gnulibc_version='2.3.2'
    Dynamic Linking:
      dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
      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 Apr  7 2004 01:54:35
    @INC:
      /usr/local/lib/perl5/5.8.3/i686-linux
      /usr/local/lib/perl5/5.8.3
      /usr/local/lib/perl5/site_perl/5.8.3/i686-linux
      /usr/local/lib/perl5/site_perl/5.8.3
      /usr/local/lib/perl5/site_perl
      /usr/share/perl5/
      .

Makefile.PL options:
  perl Makefile.PL APACHE_SRC=../apache_1.3.29/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Apache/mod_perl startup problems - PL_nowarn

Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:

>>Having libperl.so in /usr/lib/ is a great reason for lots of obscure 
>>problems, when you have one more perl installed elsewhere. That's why perl 
>>puts its libperl.so under its private tree. But some distros play it 
>>smart...
> 
> 
> Yep that was the root of the problem. Apparently Debian has decided to
> keep it in /usr/lib. I'm afraid to move that one away for fear of making
> my system unstable. With Perl built to support dynamic linking, mod_perl
> installed fine and found the right libperl.so.

It's not the first time people get tripped over this problem. I ought to 
document it in
http://perl.apache.org/docs/1.0/guide/troubleshooting.html

The diagnostics is pretty easy, always use ldd on your httpd and check which 
libperl.so it resolves to if any. That's the key. The rest is easy.

__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Apache/mod_perl startup problems - PL_nowarn

Posted by William McKee <wi...@knowmad.com>.
On Wed, Apr 07, 2004 at 10:37:15AM -0700, Stas Bekman wrote:
> And that's your problem. It picks the wrong perl library. Move it somewhere 
> out of /usr/lib and rebuild again, and it'll probably be fine. What is that 
> libperl.so?

I didn't consider that route.


> Your real libperl.so if any that you build mod_perl with lives under:
> /usr/local/lib/perl5/5.8.3/

I built Perl with -Duseshrplib and found the library files in i686/CORE/
under the directory above.


> Yes. And httpd should not be linked against libperl.so in that case.

Right, this is starting to sink in. The dynamically vs. statically link
stuff threw me for a loop but are starting to make sense.


> I think you have more than one perl installed and that's why everything is 
> messed up.
> 
> Having libperl.so in /usr/lib/ is a great reason for lots of obscure 
> problems, when you have one more perl installed elsewhere. That's why perl 
> puts its libperl.so under its private tree. But some distros play it 
> smart...

Yep that was the root of the problem. Apparently Debian has decided to
keep it in /usr/lib. I'm afraid to move that one away for fear of making
my system unstable. With Perl built to support dynamic linking, mod_perl
installed fine and found the right libperl.so.


> and what's:
> 
> % which perl

/usr/local/bin/perl


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Apache/mod_perl startup problems - PL_nowarn

Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
> On Wed, Apr 07, 2004 at 12:39:33AM -0700, Stas Bekman wrote:
> 
>>William, why do you check a binary, which is not the one that you get 
>>the error from? You need to check /usr/local/apache/bin/httpd instead. 
>>(of course it could be the same binary, but still...)
> 
> 
> Because I thought it was the same one being installed... Will check the
> actual location instead.

It's quite possible, but we can't know that. Hence I suggested that you check 
that.

>>Also please show us the output of:
>>
>>ldd /usr/local/apache/bin/httpd
> 
> 
> # ldd /usr/local/apache/bin/httpd 
         ...
> 	libperl.so => /usr/lib/libperl.so (0x4006c000)

And that's your problem. It picks the wrong perl library. Move it somewhere 
out of /usr/lib and rebuild again, and it'll probably be fine. What is that 
libperl.so?

Your real libperl.so if any that you build mod_perl with lives under:
/usr/local/lib/perl5/5.8.3/

>>and if it links to libperl.so that would be your problem, since your 
>>perl is statically linked.
> 
> 
> I see the 'useshrplib=false' in the perl -V output. Is this how you know
> that my perl is statically linked? 

Yes. And httpd should not be linked against libperl.so in that case.

> So what do I do in this case?
> Searching the docs at perl.apache.org, I see that you recommend building
> Perl dynamically for the `PL_perl_destruct_level' error. Is this also
> your recommendation for this error?
> 
> I'm surprised that my Perl didn't get built dynamically since the
> INSTALL doc says this is the default if the system supports it. I would
> think Linux would be pretty widely supported so guess there must be
> other factors involved. Is there more discussion I can read about when
> to build statically vs. dynamically? FWIW, here's the command I ran to
> compile Perl:
> 
>    sh Configure -Dotherlibdirs=/usr/share/perl5/ -des

I think you have more than one perl installed and that's why everything is 
messed up.

Having libperl.so in /usr/lib/ is a great reason for lots of obscure problems, 
when you have one more perl installed elsewhere. That's why perl puts its 
libperl.so under its private tree. But some distros play it smart...

>>Finally show us the commands you used to build apache/mp1.
> 
> 
> I used the example you showed in the docs:
> 
>     perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
>     make
>     make test (fails b/c server cannot start due to PL_nowarn issue)
>     make install

and what's:

% which perl


__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Apache/mod_perl startup problems - PL_nowarn

Posted by William McKee <wi...@knowmad.com>.
On Wed, Apr 07, 2004 at 12:39:33AM -0700, Stas Bekman wrote:
> William, why do you check a binary, which is not the one that you get 
> the error from? You need to check /usr/local/apache/bin/httpd instead. 
> (of course it could be the same binary, but still...)

Because I thought it was the same one being installed... Will check the
actual location instead.


> Also please show us the output of:
> 
> ldd /usr/local/apache/bin/httpd

# ldd /usr/local/apache/bin/httpd 
	libm.so.6 => /lib/libm.so.6 (0x4001d000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x4003f000)
	libperl.so => /usr/lib/libperl.so (0x4006c000)
	libnsl.so.1 => /lib/libnsl.so.1 (0x4018f000)
	libdl.so.2 => /lib/libdl.so.2 (0x401a4000)
	libutil.so.1 => /lib/libutil.so.1 (0x401a7000)
	libc.so.6 => /lib/libc.so.6 (0x401aa000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x402dd000)


> and if it links to libperl.so that would be your problem, since your 
> perl is statically linked.

I see the 'useshrplib=false' in the perl -V output. Is this how you know
that my perl is statically linked? So what do I do in this case?
Searching the docs at perl.apache.org, I see that you recommend building
Perl dynamically for the `PL_perl_destruct_level' error. Is this also
your recommendation for this error?

I'm surprised that my Perl didn't get built dynamically since the
INSTALL doc says this is the default if the system supports it. I would
think Linux would be pretty widely supported so guess there must be
other factors involved. Is there more discussion I can read about when
to build statically vs. dynamically? FWIW, here's the command I ran to
compile Perl:

   sh Configure -Dotherlibdirs=/usr/share/perl5/ -des


> Finally show us the commands you used to build apache/mp1.

I used the example you showed in the docs:

    perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
    make
    make test (fails b/c server cannot start due to PL_nowarn issue)
    make install


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Apache/mod_perl startup problems - PL_nowarn

Posted by Stas Bekman <st...@stason.org>.
William McKee wrote:
> Hi List,
> 
> I've spent the last several hours trying to figure out the following
> error message that I receive with Apache 1.3.29 and mod_perl 1.29:
> 
> 	/usr/local/apache/bin/httpd: relocation error:
> 	/usr/local/apache/bin/httpd: undefined symbol: PL_dowarn
> 	bin/apachectl start: httpd could not be started
> 
> This output occurs whenever I try to start the httpd that has been
> compiled. There are no compilation errors. There is nothing further in
> the error.log. I am compiling under Debian Sarge with gcc 3.3.3, Perl
> 5.8.3 and make 3.80. I have rebuilt Perl and tried to reinstall as many
> of the modules as I could. The system is a dual cpu and I did not do
> anything special when recompiling Perl.
> 
> I've completely read the short and long installation notes and searched
> the archives but could not a solution to my problem. I did try locating
> the PL_nowarn symbol via the following command:
> 
> 	nm ../apache_1.3.29/src/httpd | grep PL_nowarn
> 
> This returned nothing which seems suspicious.

William, why do you check a binary, which is not the one that you get 
the error from? You need to check /usr/local/apache/bin/httpd instead. 
(of course it could be the same binary, but still...)

Also please show us the output of:

ldd /usr/local/apache/bin/httpd

and if it links to libperl.so that would be your problem, since your 
perl is statically linked.

Finally show us the commands you used to build apache/mp1.

Thanks.

__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html