Re: backend process terminates

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Geoffrey <lists(at)serioustechnology(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: backend process terminates
Date: 2007-08-08 08:47:13
Message-ID: 20070808084713.GA27465@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 07, 2007 at 07:46:45AM -0400, Geoffrey wrote:
> I don't know all the idiosyncrasies of how this works, so bear with me
> on this. The developer at the vendor indicated that he's narrowed down
> the problem to a set of wrapper routines in their code. They are named
> OpenFile(), CloseFile() and ReadFile(); He inquired as to whether there
> might be routines in the Postgresql code with the same names that might
> be causing a conflict. Sure enough, I searched the Postgresql source
> code and found routines with the same names. I don't see how this could
> pose a problem though, as it is my understanding that the compiler will
> properly address this issue.

Yes, this could cause a problem. In general, when loading a library,
any external references are first resolved against the main
executable, then already loaded libraries, then the library being
loaded. It's all in the ELF standard, if you're interested.

As for solutions:
1. In your third party library, have the library built in such a way
that the symbols are explicitly bound to the internal library version.
There are various methods for dealing with that, it all depends on the
toolchain used to build it. I suppose this product is actually several
libraries that call eachother? Namespace would help here.

2. Make sure that any externally visible symbols in libraries are
always prefixed by a tag, like libpq does (almost all symbols are pq*).

Running "nm -D" over the main postgres executable and your libraries
should give you an idea of the scope of the problem.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2007-08-08 08:54:10 Re: Comment for column in view - "legal" or just working?
Previous Message Harald Armin Massa 2007-08-08 08:31:47 Comment for column in view - "legal" or just working?