perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Grimm ...@tgape.org>
Subject Re: compile error
Date Sun, 04 May 2003 09:06:14 GMT
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

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.

Ed


Mime
View raw message