Re: [HACKERS] Problem with dlopen and PostgreSQL - load of file failed

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: current-users(at)NetBSD(dot)org, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problem with dlopen and PostgreSQL - load of file failed
Date: 1999-07-26 02:39:47
Message-ID: m118ag7-0000bFC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Tom Lane
> "D'Arcy" "J.M." Cain <darcy(at)druid(dot)net> writes:
> > ERROR: Load of file /usr/pgsql/modules/glaccount.so failed: dlopen (/usr/pgsql/modules/glaccount.so) failed
>
> Dynamic loaders tend to be pretty horrid about that :-(. My bet is
> a failure to resolve an external reference to another shared library.
> Try using "ldd" (or local equivalent) on the shlib to find out what
> other shlibs it depends on. Be suspicious if ldd fails to show all the
> dependencies you expect (eg, practically anything will depend on libc);
> that probably means the linker failed to locate the other shlib when
> linking this one. Next make sure all those other shlibs are in the
> right places, and are known to the system if your system keeps a table
> of shlibs. Then start checking *their* dependencies...

OK, so what do I do to fix it? Do I need more options to my link command?
My link rule is now this.

.o.so:
ld -Bshareable -L ${PGDIR}/lib -lpq -lc -o $@ $<

And here is what ldd shows.

[darcy(at)smaug:/usr/pgsql/modules] $ ldd glaccount.so
glaccount.so:
-lpq => not found
-lc.12 => /usr/lib/libc.so.12

The file libpq.so exists in the directory ${PGDIR}/lib and I still get the
same problem. I tried nm and I get the following external symbols.

[darcy(at)smaug:/usr/pgsql/modules] $ nm -Cn glaccount.so
U CurrentMemoryContext
U MemoryContextAlloc
U _ctype_
U elog
U sprintf
U strtol
[... internal symbols ...]

I assume those first two are in the libpq library that wasn't found.

And I just now had a panic while investigating why ldconfig is not being built.
Can I assume that ldconfig is not used in an ELF system? Did faking it
out and trying to build it cause the panic? The panic was;

panic: lockmgr: pid %d, not exclusive lock holder %d unlocking

I have crash files if anyone is interested.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-07-26 02:43:00 Re: [SQL] inserts/updates problem under stressing !
Previous Message Vadim Mikheev 1999-07-26 02:39:14 Re: [SQL] inserts/updates problem under stressing !