Thread: BUG #1491: Getting an "undefined symbol" when loading contrib mod.

BUG #1491: Getting an "undefined symbol" when loading contrib mod.

From
"Alexis Wilke"
Date:
The following bug has been logged online:

Bug reference:      1491
Logged by:          Alexis Wilke
Email address:      alexis@m2osw.com
PostgreSQL version: 8.0.1
Operating system:   Linux
Description:        Getting an "undefined symbol" when loading contrib mod.
Details:

I'm trying to use ltree to sort one of my table using a tree like column
("1", "1.1", "1.2", "2", "2.1", etc.)

Everything compiles, after my fix to the .sql.in -> .sql convertion
($(libdir) instead of $$libdir in pgxs.mk) and everything also seems to be
installed properly.

However, in version 7.4.6 and version 8.0.1, when I try to load the module,
it says it can't find the symbol errstart (one of the elog functions better
known as ereport).

There are a few versions if that helps at all...

   gcc (GCC) 3.4.3

   GNU ld version 2.13.90.0.18 20030206

   ldd (GNU libc) 2.3.2

There is the complete message I'm getting from postgres

crm=> SET search_path = public;
SET
crm=> CREATE FUNCTION ltree_in(cstring)
crm-> RETURNS ltree
crm-> AS '/usr/local/pgsql/lib/ltree'
crm-> LANGUAGE 'C' WITH (isstrict);
NOTICE:  ProcedureCreate: type ltree is not yet defined
ERROR:  Load of file /usr/local/pgsql/lib/ltree.so failed:
/usr/local/pgsql/lib/ltree.so: undefined symbol: errstart

Re: BUG #1491: Getting an "undefined symbol" when loading contrib mod.

From
Tom Lane
Date:
"Alexis Wilke" <alexis@m2osw.com> writes:
> Operating system:   Linux

You need to be a lot more specific than that, because this stuff works
fine on all the variants of Linux we know about.

> ERROR:  Load of file /usr/local/pgsql/lib/ltree.so failed:
> /usr/local/pgsql/lib/ltree.so: undefined symbol: errstart

Are you sure you're loading into a 7.4-or-later backend?  (Check "select
version();" to be certain.)  The only other possibility I can think of
is that the backend has been stripped of symbols --- in which case it's
not errstart that's at fault particularly, that just happens to be the
first missing symbol reported.

            regards, tom lane

Re: BUG #1491: Getting an "undefined symbol" when loading

From
alexis@m2osw.com
Date:
Tom,

Ha! If I'd known of the select version(); I would have fixed the problem
sooner! It all works when you run the right version... 8-)

You may want to specify that select command in the doc in regard to
modules so people can test their backend version before to bug you guys.

Thank you for the hint, very helpful. This ltree stuff is really cool!

Alexis


On Mon, 21 Feb 2005, Tom Lane wrote:

> "Alexis Wilke" <alexis@m2osw.com> writes:
> > Operating system:   Linux
>
> You need to be a lot more specific than that, because this stuff works
> fine on all the variants of Linux we know about.
>
> > ERROR:  Load of file /usr/local/pgsql/lib/ltree.so failed:
> > /usr/local/pgsql/lib/ltree.so: undefined symbol: errstart
>
> Are you sure you're loading into a 7.4-or-later backend?  (Check "select
> version();" to be certain.)  The only other possibility I can think of
> is that the backend has been stripped of symbols --- in which case it's
> not errstart that's at fault particularly, that just happens to be the
> first missing symbol reported.
>
>             regards, tom lane
>