Bug 162198

Summary: Shared Object Issues when Loading PL/Perl
Product: [Fedora] Fedora Reporter: Pete Toscano <shubnub>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: hhorak, perl-devel, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-04 23:17:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pete Toscano 2005-06-30 19:14:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Epiphany/1.6.1

Description of problem:
I'm trying to create a function in the "plperl" language.  In order to use it in my database, I need to create it in that database.  When I try to createlang as the postgres user, I get the following error:

[foo@bar ~]$ createlang -U postgres -d baz plperl
createlang: language installation failed: ERROR:  could not load library "/usr/lib/pgsql/plperl.so": libperl.so: cannot open shared object file: No such file or directory


Version-Release number of selected component (if applicable):
postgresql-pl-8.0.3-1

How reproducible:
Always

Steps to Reproduce:
1. createdb -U postgres foo
2. createlang -U postgres -d foo plperl


Actual Results:  createlang: language installation failed: ERROR:  could not load library "/usr/lib/pgsql/plperl.so": libperl.so: cannot open shared object file: No such file or directory

Expected Results:  No error message and a "0" result code.

Additional info:

I tried recompiling PostgreSQL from the SRPM on one of the boxes I'm seeing the error on, but that didn't help.  I verified the error on my laptop.  Plperl did load correctly on an FC2 box I have.

Comment 1 Tom Lane 2005-06-30 22:14:24 UTC
The problem is that the dynamic loader is not finding libperl.so; which is not
too amazing because the perl package puts libperl.so in a pretty nonstandard
place, such as
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
Ordinarily I'd expect the perl package to have hacked /etc/ld.so.conf to put
that directory into the search path, but it seems it doesn't do that.  Warren,
am I supposed to add an rpath to the plperl.so file to find libperl.so?  I
thought our packaging policy generally frowns on using rpath.

In the meantime, Pete, hacking /etc/ld.so.conf is certainly your best short-term
workaround.

Comment 2 Pete Toscano 2005-06-30 22:23:13 UTC
Confirmed.  This fix works.  Adding a file with the path to my libperl.so to a
new file in /etc/ld.so.conf.d and running ldconfig fixed the immediate problem.

Thanks

Comment 3 Warren Togami 2005-07-01 02:10:02 UTC
Our modern distributions contain explicit symlinks for compatibility with known
binary compatible versions of perl, so stuff built with that kind of
out-of-the-way RPATH are not likely to break unless the symlinks are explicitly
removed in a later version of the perl package.

I don't know why it was done this way originally.  Maybe to allow multiple
versions of perl to be installed simultaneously and avoid links from using the
wrong libperl.so?  If this is the case, then it probably made sense during the
transitions from earlier perl major versions.

RPATH to the full path of the libperl.so that was available during build time
seems to be what everything else that links against libperl.so does?

Comment 4 Tom Lane 2005-10-04 23:17:00 UTC
rpath added in postgresql-8.0.4-2.FC4.1.