Обсуждение: plperl again but different problem

Поиск
Список
Период
Сортировка

plperl again but different problem

От
Marcin Giedz
Дата:
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

Re: plperl again but different problem

От
Marcin Giedz
Дата:
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

Re: plperl again but different problem

От
Marcin Giedz
Дата:
Dnia wtorek, 13 września 2005 14:42, Sergiusz Jarczyk napisał:
> Hi Marcin
>
> Marcin Giedz napisał(a):
> >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?
>





> 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

Re: plperl again but different problem

От
Marcin Giedz
Дата:
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ł:
> > Hi Marcin
> >
> > Marcin Giedz napisał(a):
> > >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?
> >
> > 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

Re: plperl again but different problem

От
Tom Lane
Дата:
Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
>> 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

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

Re: plperl again but different problem

От
Marcin Giedz
Дата:
Dnia wtorek, 13 września 2005 17:24, Tom Lane napisał:
> Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> >> 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
>
> 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

Re: plperl again but different problem

От
Tom Lane
Дата:
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

Re: plperl again but different problem

От
Sergiusz Jarczyk
Дата:
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


Re: plperl again but different problem

От
Sergiusz Jarczyk
Дата:
Hi

Tom Lane napisał(a):

>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.
>
>

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


Re: plperl again but different problem

От
Marcin Giedz
Дата:
Tom Lane napisał(a):

>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?
>
~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

Re: plperl again but different problem

От
Marcin Giedz
Дата:
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
>


Re: plperl again but different problem

От
Tom Lane
Дата:
Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> Tom Lane napisa�(a):
>> How big a plperl.so do you have?
>>
> ~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

Re: plperl again but different problem

От
Sergiusz Jarczyk
Дата:
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


Re: plperl again but different problem

От
Marcin Giedz
Дата:
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

Re: plperl again but different problem

От
Tom Lane
Дата:
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

Re: plperl again but different problem

От
Sergiusz Jarczyk
Дата:
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


Re: plperl again but different problem

От
Marcin Giedz
Дата:
Ok guys... thanks you both ;) I've installed perl once again into
default location and now IT'S ALIVE !!!!!

Thanks once again.

Marcin

Re: plperl again but different problem

От
David
Дата:
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.