Search Postgresql Archives

Re: backend process terminates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux