Home > Archive > PostgreSQL Administration > September 2005 > plperl again but different problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author plperl again but different problem
Marcin Giedz

2005-09-13, 9:24 am

Hello..

I've installed plperl.so in postgresql lib directory but when I try to create
lang, such error occures:

pgsql2-test:~# su pgadmin
pgadmin@pgsql2-test:/root$ /usr/local/postgresql/bin/createlang -p 5433
plperlu pl
createlang: language installation failed: ERROR: could not load library
"/usr/local/postgresql-8.0.3/lib/plperl.so": /usr/local/postgresql-8.0.3/lib/plperl.so:
undefined symbol: Perl_croak
pgadmin@pgsql2-test:/root$

I've even compiled perl from sources but still have this error. What's going
on?

Thx,
Marcin

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Marcin Giedz

2005-09-13, 9:24 am

Dnia wtorek, 13 września 2005 14:18, Marcin Giedz napisał:
> Hello..

Ohhhh I didn't mention what Linux .....

Debian Sarge 3.1
kernel 2.6.12.5
perl lates 5.8.7 from sources
perl 5.8.4-8 from dselect
postgresql 8.0.3 from sources

>
> I've installed plperl.so in postgresql lib directory but when I try to
> create lang, such error occures:
>
> pgsql2-test:~# su pgadmin
> pgadmin@pgsql2-test:/root$ /usr/local/postgresql/bin/createlang -p 5433
> plperlu pl
> createlang: language installation failed: ERROR: could not load library
> "/usr/local/postgresql-8.0.3/lib/plperl.so":
> /usr/local/postgresql-8.0.3/lib/plperl.so: undefined symbol: Perl_croak
> pgadmin@pgsql2-test:/root$
>
> I've even compiled perl from sources but still have this error. What's
> going on?
>
> Thx,
> Marcin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Marcin Giedz

2005-09-13, 11:24 am

Dnia wtorek, 13 września 2005 14:42, Sergiusz Jarczyk napisał:
> Hi Marcin
>
> Marcin Giedz napisał(a):
>






> If you have both Perl installed (from distro and compiled from the
> source), it's mostly the problem of the wrong
> libperl.so used by Postgres, i.e. it uses not the one it was compiled
> with...


No... I simply removed the old one taken from deb I have only one - new
installed from sources.

Marcin

>
> Sergiusz


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Marcin Giedz

2005-09-13, 11:24 am

Dnia wtorek, 13 września 2005 17:01, Marcin Giedz napisał:

Additional info: I've also checked plperl with postgresql snapshot - problem
still exists ;( -

didn't anyone have something similar? or maybe I'm only one who uses Sarge
3.1? :D:D

Marcin


> Dnia wtorek, 13 września 2005 14:42, Sergiusz Jarczyk napisał:
>
> No... I simply removed the old one taken from deb I have only one - new
> installed from sources.
>
> Marcin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Tom Lane

2005-09-13, 11:24 am

Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:[color=darkre
d]

I think you've got some kind of mismatch between the compilation options
for Perl proper and those for plperl. IIRC, Perl can spell its exported
function names in several different ways (eg, with or without the Perl_
prefix). It looks like plperl is expecting a different convention than
what the libperl.so file was actually built with.

Use ldd on plperl.so to double check which libperl it's trying to link
to. Double check that the Perl header files you compiled plperl against
came from the same Perl build that produced libperl.so.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Marcin Giedz

2005-09-13, 1:24 pm

Dnia wtorek, 13 września 2005 17:24, Tom Lane napisał:
> Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
>
> I think you've got some kind of mismatch between the compilation options
> for Perl proper and those for plperl. IIRC, Perl can spell its exported
> function names in several different ways (eg, with or without the Perl_
> prefix). It looks like plperl is expecting a different convention than
> what the libperl.so file was actually built with.
>
> Use ldd on plperl.so to double check which libperl it's trying to link
> to. Double check that the Perl header files you compiled plperl against
> came from the same Perl build that produced libperl.so.


pgsql2-test:/usr/src/postgresql-snapshot/src/pl/plperl# ldd libplperl.so
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7fc7000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7fa4000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7f95000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e60000)
libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0xb7e33000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
pgsql2-test:/usr/src/postgresql-snapshot/src/pl/plperl#

I don't see any libperl.so :( But doesn't plperl use shared libperl library?
"....libperl must have been built as a shared library, which is usually not
the case in standard installations..." taken from README file

I've changed configure script and put PERL variable as
PERL=/usr/local/perl/bin/perl - so all things related to perl where taken
from this place.

>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Tom Lane

2005-09-13, 1:24 pm

Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> I don't see any libperl.so :( But doesn't plperl use shared libperl library?


Yeah, it's supposed to. On an FC4 machine I get

$ ldd libplperl.so
linux-gate.so.1 => (0x00682000)
libperl.so => /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so (0x00a3f000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00520000)
libnsl.so.1 => /lib/libnsl.so.1 (0x006b5000)
libdl.so.2 => /lib/libdl.so.2 (0x00c22000)
libm.so.6 => /lib/libm.so.6 (0x00e9e000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x0049c000)
libutil.so.1 => /lib/libutil.so.1 (0x00125000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00129000)
libc.so.6 => /lib/libc.so.6 (0x001d0000)
/lib/ld-linux.so.2 (0x00109000)

How big a plperl.so do you have? Mine's about 160K (in a debug-enabled
build), whereas libperl.so is about 1.3M on this machine. If your
plperl.so is over a megabyte then libperl might be statically linked
into it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Sergiusz Jarczyk

2005-09-13, 1:24 pm

Hi

Tom Lane napisa³(a):

>Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
>
>
>
>Yeah, it's supposed to. On an FC4 machine I get
>
>$ ldd libplperl.so
> linux-gate.so.1 => (0x00682000)
> libperl.so => /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so (0x00a3f000)
> libresolv.so.2 => /lib/libresolv.so.2 (0x00520000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x006b5000)
> libdl.so.2 => /lib/libdl.so.2 (0x00c22000)
> libm.so.6 => /lib/libm.so.6 (0x00e9e000)
> libcrypt.so.1 => /lib/libcrypt.so.1 (0x0049c000)
> libutil.so.1 => /lib/libutil.so.1 (0x00125000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x00129000)
> libc.so.6 => /lib/libc.so.6 (0x001d0000)
> /lib/ld-linux.so.2 (0x00109000)
>
>How big a plperl.so do you have? Mine's about 160K (in a debug-enabled
>build), whereas libperl.so is about 1.3M on this machine. If your
>plperl.so is over a megabyte then libperl might be statically linked
>into it.
>
>


For PostgreSQL compiled from sources, it's statically linked:

postgres@ns02:/usr/local/pgsql/lib$ ldd plpgsql.so
libc.so.6 => /lib/tls/libc.so.6 (0xb7ea5000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Sergiusz


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sergiusz Jarczyk

2005-09-13, 1:24 pm

Hi again
My PostgreSQL (built from sources) is running on Sarge too, bit I didn't
have any such a problems.
What's more, I have both Perls installed in standard places. Try to run
'locate *libperl*' to check
if there isn't more then one on your system.

Sergiusz


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Marcin Giedz

2005-09-13, 1:24 pm

Tom Lane napisa³(a):

>Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
>
>
>
>Yeah, it's supposed to. On an FC4 machine I get
>
>$ ldd libplperl.so
> linux-gate.so.1 => (0x00682000)
> libperl.so => /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so (0x00a3f000)
> libresolv.so.2 => /lib/libresolv.so.2 (0x00520000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x006b5000)
> libdl.so.2 => /lib/libdl.so.2 (0x00c22000)
> libm.so.6 => /lib/libm.so.6 (0x00e9e000)
> libcrypt.so.1 => /lib/libcrypt.so.1 (0x0049c000)
> libutil.so.1 => /lib/libutil.so.1 (0x00125000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x00129000)
> libc.so.6 => /lib/libc.so.6 (0x001d0000)
> /lib/ld-linux.so.2 (0x00109000)
>
>How big a plperl.so do you have?
>

~57kB plperl.so

>Mine's about 160K (in a debug-enabled
>build), whereas libperl.so is about 1.3M on this machine.
>

~1.2MB libperl.so

>If your
>plperl.so is over a megabyte then libperl might be statically linked
>into it.
>
> regards, tom lane
>
>
>

Marcin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Marcin Giedz

2005-09-13, 8:24 pm

Sergiusz Jarczyk napisał(a):

> Hi again
> My PostgreSQL (built from sources) is running on Sarge too, bit I
> didn't have any such a problems.
> What's more, I have both Perls installed in standard places. Try to
> run 'locate *libperl*' to check


Does nothing :( - hmmmm???
What packages related to perl do you have installed?
This is for my case:
pgsql2-test:/usr/lib# dpkg -l | grep perl
ii libperl-dev 5.8.4-8 Perl library: development files
ii libperl5.8 5.8.4-8 Shared Perl library
ii perl 5.8.4-8 Larry Wall's Practical Extraction and
Report
ii perl-base 5.8.4-8 The Pathologically Eclectic Rubbish Lister
ii perl-modules 5.8.4-8 Core Perl modules
pgsql2-test:/usr/lib#

Marcin


> if there isn't more then one on your system.
>
> Sergiusz
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Tom Lane

2005-09-13, 8:24 pm

Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> Tom Lane napisa³(a):
> ~57kB plperl.so
> ~1.2MB libperl.so


Well, it's not statically linked then. You should go back into
src/pl/plperl and do "make clean all" so you can see what command was
done to produce plperl.so.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sergiusz Jarczyk

2005-09-13, 8:24 pm

NNTP-Posting-Host: news.hub.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.hub.org 1126637090 42340 200.46.204.72 (13 Sep 2005 18:44:50 GMT)
X-Complaints-To: usenet@news.hub.org
NNTP-Posting-Date: Tue, 13 Sep 2005 18:44:50 +0000 (UTC)
X-Received: from postgresql.org (svr1.postgresql.org [200.46.204.71])
by news.hub.org (8.13.1/8.13.1) with ESMTP id j8DIin1m042328
for <pgsql-admin@news.hub.org>; Tue, 13 Sep 2005 18:44:49 GMT
(envelope-from pgsql-admin- owner+M18888@postgre
sql.org)
X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org
X-Received: from localhost (av.hub.org [200.46.204.144])
by svr1.postgresql.org (Postfix) with ESMTP id A4E3ED8D97
for <pgsql-admin-postgresql.org@localhost.postgresql.org>; Tue, 13 Sep 2005 15:26:41 -0300 (ADT)
X-Received: from svr1.postgresql.org ([200.46.204.71])
by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024)
with ESMTP id 36868-04
for <pgsql-admin-postgresql.org@localhost.postgresql.org>;
Tue, 13 Sep 2005 18:26:34 +0000 (GMT)
X-Received: from ns01.qresc.com (ns01.qresc.com [212.244.145.2])
by svr1.postgresql.org (Postfix) with ESMTP id B7471D8D71
for <pgsql-admin@postgresql.org>; Tue, 13 Sep 2005 15:26:31 -0300 (ADT)
X-Received: from [127.0.0.1] (ip-85-198-229-198.broker.com.pl [85.198.229.198])
by ns01.qresc.com (8.13.4/8.13.4/Debian-3) with ESMTP id j8DILmXW004279;
Tue, 13 Sep 2005 20:21:52 +0200
X-User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: pl, en-us, en
X-To: Marcin Giedz <marcin.giedz@eulerhermes.pl>
X-Cc: pgsql-admin@postgresql.org
X-In-Reply-To: <43271488.3020209@eulerhermes.pl>
X-Virus-Scanned: by amavisd-new at hub.org
X-Spam-Status: No, hits=0 required=5 tests=[none]
X-Spam-Level:
X-Mailing-List: pgsql-admin
X-List-Archive: <http://archives.postgresql.org/pgsql-admin>
X-List-Help: < mailto:majordomo@pos
tgresql.org?body=help>
X-List-ID: <pgsql-admin.postgresql.org>
X-List-Owner: <mailto:pgsql-admin-owner@postgresql.org>
X-List-Post: <mailto:pgsql-admin@postgresql.org>
X-List-Subscribe: < mailto:majordomo@pos
tgresql.org?body=sub%20pgsql-admin>
X-List-Unsubscribe: < mailto:majordomo@pos
tgresql.org?body=unsub%20pgsql-admin>
X-Precedence: bulk
Xref: news.hub.org pgsql.admin:3216

Hi
Here is what I have:

sjarczyk@devel:~$ dpkg -l | grep -i perl
ii libcompress-zl 1.34-1 Perl module for creation and
manipulation of
ii libdbi-perl 1.46-6 Perl5 database interface by Tim Bunce
ii libft-perl 1.2-14 Perl module for the FreeType library
ii libnet-daemon- 0.38-1 Perl module for building portable Perl
daemo
ii libpcre3 4.5-1.2sarge1 Perl 5 Compatible Regular Expression
Library
ii libpcre3-dev 4.5-1.2sarge1 Perl 5 Compatible Regular Expression
Library
ii libperl5.8 5.8.4-8 Shared Perl library
ii libplrpc-perl 0.2017-1 Perl extensions for writing PlRPC
servers an
ii libtext-iconv- 1.2-3 Convert between character sets in Perl
ii perl 5.8.4-8 Larry Wall's Practical Extraction and
Report
ii perl-base 5.8.4-8 The Pathologically Eclectic Rubbish Lister
ii perl-modules 5.8.4-8 Core Perl modules
sjarczyk@devel:~$

But I doubt if it'll help you - please remember for my development I'm using
perl built from sources (installed at /usr/local), as I need
non-threaded version.

Sergiusz


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Marcin Giedz

2005-09-13, 8:24 pm

OK ... I have compiled it once again - really don't know why this time
libperl is visible?:

pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl#
pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl# ldd libplperl.so
libperl.so => /usr/lib/libperl.so (0xb7ed1000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7ecd000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7eab000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7e9c000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7d67000)
libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0xb7d3a000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl#

But still problem with Perl_craok exists during creating lang plperl ;(

Marcin

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Tom Lane

2005-09-13, 8:24 pm

Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> OK ... I have compiled it once again - really don't know why this time
> libperl is visible?:


Sounds like you did it wrong the first time ;-)

> pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl# ldd libplperl.so
> libperl.so => /usr/lib/libperl.so (0xb7ed1000)


This is linking to a system copy of libperl. I thought you said you
were building against a private copy? Maybe you forgot to alter the
ldconfig search path to find the private copy first.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sergiusz Jarczyk

2005-09-13, 8:24 pm

Marcin Giedz napisa³(a):

> OK ... I have compiled it once again - really don't know why this time
> libperl is visible?:
>
> pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl#
> pgsql2-test:/usr/src/postgresql-8.0.3/src/pl/plperl# ldd libplperl.so
> libperl.so => /usr/lib/libperl.so (0xb7ed1000)


You said you compiled Perl from source, but the above line shows that
libplperl.so is linked against
libperl from binary packages...

Sergiusz


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Marcin Giedz

2005-09-13, 8:24 pm

Ok guys... thanks you both ;) I've installed perl once again into
default location and now IT'S ALIVE !!!!!

Thanks once again.

Marcin

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

David

2005-09-14, 7:23 am

On Tue, Sep 13, 2005 at 05:17:55PM +0200, Marcin Giedz wrote:
> Dnia wtorek, 13 wrze??nia 2005 17:01, Marcin Giedz napisa??:
>
> Additional info: I've also checked plperl with postgresql snapshot - problem
> still exists ;( -
>
> didn't anyone have something similar? or maybe I'm only one who uses Sarge
> 3.1? :D:D


You might be best served by removing your self-compiled perls and
postgresql's, and installing or keeping the Debian 3.1 Perl and pulling
postgresql-8.0 from testing. That's the setup I have and it seems to
work flawlessly.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com