Обсуждение: PostgreSQL ld.so.1 problem (solaris)

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

PostgreSQL ld.so.1 problem (solaris)

От
Urban Widmark
Дата:
Hello

I'm having a trigger/link/symbol problem in PostgreSQL 7.0.2 (same with
6.5.3) on a gnu'ified Solaris 2.5.1 box.

gcc 2.7.2.3 & 2.95.2
binutils 2.9.1


% psql -f ~/pgsql/sql/initial-data.pgsql a0002a

psql:/home/puw/pgsql/sql/initial-data.pgsql:1: ERROR:  Load of file
/usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:
/usr/local/pgsql/bin/postmaster: fatal: relocation error: file
/usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced
symbol not found


initial-data.pgsql is simply a single insert on a table which has a
PL/pgSQL trigger defined on it. I get the same error in these regression
tests:

results/create_function_2.out
results/plpgsql.out
results/triggers.out

Searching the archives gave me this (actually google gave me this; the
search function on my local mirror, www.se.postgresql.org, seems to be
broken, the search on www.postgresql.org doesn't find any ref to
CurrentMemoryContext in the pgsql-ports list ...) :
  http://www.postgresql.org/mhonarc/pgsql-ports/1999-11/msg00049.html
    found no reply
  http://mail-index.netbsd.org/current-users/1999/07/27/0006.html
    drifts into an ELF vs a.out discussion ...

The symbol is defined in /usr/local/pgsql/bin/postgres and undefined in
/usr/local/pgsql/lib/plpgsql.so

Ideas anyone? Personally I suspect binutils/ld.so.1 or some wierd flag to
ld missing ...

Failing a quick answer, could someone point me to which code loads
plpgsql.so (psql or postgres would be a start :)

Thanks.

/Urban


RE: PostgreSQL ld.so.1 problem (solaris)

От
Urban Widmark
Дата:
On Wed, 19 Jul 2000, Carlos Villegas wrote:

> Hi,

Hello

> working. The problem is that some symbols used by plpgsql.so are
> defined in the postgres executable. However, when loading the
> library dynamically using the dlopen function, the
> caller symbols are not available to the shared object.

Yes, that's sort of what I (with the help of nm) was thinking too.

> Fortunately, there is a flag to export the caller symbols
> (in this case postgres) to the shared library. I got
> it from the man page of dlopen!

The Solaris 2.5.1 manpage only lists 3 RTLD_ flags but the dlfcn.h lists a
lot more ...


> The patch at the end should do the job.

It doesn't for me. I still get this in the create_function_2 regression
test.

LOAD '/export/tmp/postgresql-7.0.2/src/test/regress/input/../regress.so';
ERROR:  Load of file
/export/tmp/postgresql-7.0.2/src/test/regress/input/../regress.so failed:
ld.so.1: /home/postgres/bin/postmaster: fatal: relocation error:  file
/export/tmp/postgresql-7.0.2/src/test/regress/input/../regress.so: symbol
CurrentMemoryContext: referenced symbol not found

Maybe this is a solaris 2.5.1/2.6 difference? Maybe there is a reason that
flag isn't mentioned in the manpage ...

I have tried to make very sure that there are no traces of the old
postgres binaries and libraries on the system, so I don't think that is it
(unless you need to do something silly like reboot to replace a .so on
solaris).


Oh, well. It was never that important to me. Thanks for sending the patch,
it does look right but for some reason it doesn't seem to work. If someone
has other patches or want to guess things I may have done wrong I'll
gladly test that.

/Urban