Return-Path: Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 55600 invoked by uid 500); 4 May 2003 23:37:11 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 55589 invoked from network); 4 May 2003 23:37:10 -0000 Message-ID: <3EB5A426.2010800@stason.org> Date: Mon, 05 May 2003 09:37:10 +1000 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ed Grimm Cc: J S , modperl@perl.apache.org Subject: Re: compile error References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ed Grimm wrote: > On Sat, 3 May 2003, Stas Bekman wrote: > > >>J S wrote: >> >>>>>>>The problem now is I can't get apache to start: >>>>>>> >>>>>>>smpd9$ /opt/apache_1.3.27/bin/apachectl configtest >>>>>>>Syntax error on line 208 of /opt/apache_1.3.27/conf/httpd.conf: >>>>>>>Cannot load /opt/apache_1.3.27/libexec/libperl.so into server: >>>>>>>ld.so.1: /opt/apache_1.3.27/bin/httpd: fatal: relocation error: >>>>>>>file /opt/apache_1.3.27/libexec/libperl.so: symbol Perl_vmess: >>>>>>>referenced symbol not found >>>>>> >>>>>>[...] >>>>>> >>>>>> >>>>>>>I have a bit more debug for you but I'm not sure how meaningful >>>>>>>this is: >>>>>> >>>>>>All, but one bit is missing from the puzzle >>>>>> >>>>>> >>>>>>># ldd ../libexec/libperl.so >>>>>>> libperl.so => >>>>>>>/opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so >>>>>> >>>>are you sure that ../libexec/libperl.so is >>>>/opt/apache_1.3.27/libexec/libperl.so? >>> >>> >>>Definitely. >>> >>>Since you show below that >>> >>> >>>>/opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so has the symbol >>>>Perl_vmess defined and it's the one ldd sees in >>>>/opt/apache_1.3.27/libexec/libperl.so it should work just fine. >>>>Usually when this problem happens when you get the wrong .so loaded. >>> >>> >>>These are the only libperl.so files on the box: >>> >>>smpd9$ find / -name libperl.so 2>/dev/null >>>/opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so >>>/opt/apache_1.3.27/libexec/libperl.so >>>/home/src/perl-5.8.0/libperl.so >>>smpd9$ nm /opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so | grep >>>-i vmess >>>[368] | 995152| 716|FUNC |GLOB |0 |8 |Perl_vmess >>>smpd9$ nm /opt/apache_1.3.27/libexec/libperl.so | grep -i vmess >>>[1645] | 0| 0|FUNC |GLOB |0 |UNDEF |Perl_vmess >>>smpd9$ nm /home/src/perl-5.8.0/libperl.so | grep -i vmess >>>[368] | 995152| 716|FUNC |GLOB |0 |8 |Perl_vmess >> >>Looks absolutely fine to me. The first and the last are the same files. >> >> >>>>>>># nm -r ../libexec/libperl.so >>>>>> >>>>>> >>>>>> >>>>>>>[1356] | 0| 0|FUNC |GLOB |0 |UNDEF >>>>>>>|libperl.so:Perl_vmess >>>>>> >>>>>> >>>>>> >>>>>>What's the output of >>>>>> >>>>>>nm /opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so | grep >>>>>>Perl_vmess >>>>>> >>>>> >>>>>smpd9$ nm /opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so | >>>>>grep Perl_vmess >>>>>[368] | 995152| 716|FUNC |GLOB |0 |8 |Perl_vmess >>>> >>I'm not familiar with peculiarities of Solaris. Perhaps someone knows >>can give us help here. May be ask at some Solaris specific list? Since >>it seems to be a generic linking/loading problem. > > > > > Doing a closer read, I'm seeing the issue: > > >>>>>>>smpd9$ /opt/apache_1.3.27/bin/apachectl configtest >>>>>>>Syntax error on line 208 of /opt/apache_1.3.27/conf/httpd.conf: >>>>>>>Cannot load /opt/apache_1.3.27/libexec/libperl.so into server: >>>>>>>ld.so.1: /opt/apache_1.3.27/bin/httpd: fatal: relocation error: >>>>>>>file /opt/apache_1.3.27/libexec/libperl.so: symbol Perl_vmess: >>>>>>>referenced symbol not found >>>>>> > >>>smpd9$ nm /opt/apache_1.3.27/libexec/libperl.so | grep -i vmess >>>[1645] | 0| 0|FUNC |GLOB |0 |UNDEF |Perl_vmess >> > > Apache is reporting that it's using the one version of libperl.so which > does not have the symbol definition, so there's no surprise that it > doesn't work. Fix that one version of libperl.so Confusingly, mp1 is using the same libname as perl. Do you say that this is the cause of the problem? > Now, as far as > > >>>>>>># ldd ../libexec/libperl.so >>>>>>> libperl.so => >>>>>>>/opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/libperl.so >>>>>> > > ldd determines linkage by its current LD_LIBRARY_PATH, as well as other > factors. Given that apache puts its libexec directory in said > environment variable, apache is seeing a recursive dependancy, which is > resolved immediately, because it has, of course, already begun the load > of that file. To verify, try (assuming a Bourne shell) > > # LD_LIBRARY_PATH=/opt/apache_1.3.27/libexec:$LD_LIBRARY_PATH ldd ../libexec/libperl.so > > The Solaris quirk is that dynamic loaded libraries are almost always > dynamically located. In fact, I'm not certain it supports compile-time > locating dynamic libraries. So J.S. should start httpd as: LD_LIBRARY_PATH=/opt/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE/:LD_LIBRARY_PATH \ httpd ? Hmm, should renaming /opt/apache_1.3.27/libexec/libperl.so to /opt/apache_1.3.27/libexec/libmodperl.so help? Of course you need to adjust httpd.conf as well. __________________________________________________________________ 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