public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jacob Champion <[email protected]>
To: Nico Williams <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Daniel Schreiber <[email protected]>
Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times
Date: Wed, 22 Apr 2026 15:10:07 -0700
Message-ID: <CAOYmi+nJ19kj4bnyyX66VpvTPhjaGVWGvPsyVQdnV=R6aLGo0A@mail.gmail.com> (raw)
In-Reply-To: <aekf4cx42tNs6C0j@ubby>
References: <[email protected]>
	<CAOYmi+=e9bQQa1jgLqZ18m5w-7KA44VeL9FON6i2gd8bi=d5Jw@mail.gmail.com>
	<CAOYmi+kac3wEE3iqxHfHCNd_n2i-Or=n+Qk8_G24UZn2uz3DyQ@mail.gmail.com>
	<aekf4cx42tNs6C0j@ubby>

On Wed, Apr 22, 2026 at 12:22 PM Nico Williams <[email protected]> wrote:
> Leaking a dl handle is a way to prevent unloading.  Not saying that's a
> great answer, just that it's a workaround.

Hmm, I did that for our handle to libpq-oauth, but I imagine that
leaking a handle to _ourselves_ may make someone very unhappy with us
at some point? Plus, it might kick off the tiniest, most pointless
arms race:

    // why does libpq do this
    dlclose(libpq_handle);
    dlclose(libpq_handle);

I guess we could play around with RTLD_NODELETE... Something to keep
in the back pocket, maybe?

--Jacob





view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times
  In-Reply-To: <CAOYmi+nJ19kj4bnyyX66VpvTPhjaGVWGvPsyVQdnV=R6aLGo0A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox