Re: [HACKERS] Linking libpq statically to libssl - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] Linking libpq statically to libssl
Date
Msg-id f5f53163-0536-ed09-5b1d-aeaccecc1c29@2ndquadrant.com
Whole thread Raw
In response to [HACKERS] Linking libpq statically to libssl  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: [HACKERS] Linking libpq statically to libssl  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On 10/27/17 08:24, Daniele Varrazzo wrote:
> I have a problem building binary packages for psycopg2. Binary
> packages ship with their own copies of libpq and libssl;

Aside from the advice of "don't do that" ...

> however if
> another python package links to libssl the library will be imported
> twice with conflicting symbols, likely resulting in a segfault (see
> https://github.com/psycopg/psycopg2/issues/543). This happens e.g. if
> a python script both connects to postgres and opens an https resource.

... the standard solutions to this problem are symbol versioning and
linker flags to avoid making all symbols globally available.  libpq has
symbol versioning.  Maybe the libssl you are using does not.  Also, for
example, if you dlopen() with RTLD_LOCAL, the symbols will not be
globally available, so there should be no conflicts.

This needs cooperation from various different parties, and the details
will likely be platform dependent.  But it's generally a solved problem.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: [HACKERS] Dynamic result sets from procedures
Next
From: Nico Williams
Date:
Subject: Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints