Bug 162198 - Shared Object Issues when Loading PL/Perl
Shared Object Issues when Loading PL/Perl
Product: Fedora
Classification: Fedora
Component: postgresql (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2005-06-30 15:14 EDT by Pete Toscano
Modified: 2013-07-02 23:06 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-04 19:17:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pete Toscano 2005-06-30 15:14:02 EDT
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):

How reproducible:

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 18:14:24 EDT
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
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
Comment 2 Pete Toscano 2005-06-30 18:23:13 EDT
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.

Comment 3 Warren Togami 2005-06-30 22:10:02 EDT
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 19:17:00 EDT
rpath added in postgresql-8.0.4-2.FC4.1.

Note You need to log in before you can comment on or make changes to this bug.