Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFfn5-005QHL-2Z for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 22:11:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFfm5-00FWFv-2g for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 22:10:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFfm5-00FWFm-1b for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 22:10:25 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFfm2-00000002XgI-23Qs for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 22:10:24 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-899d6b7b073so62628906d6.2 for ; Wed, 22 Apr 2026 15:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776895820; cv=none; d=google.com; s=arc-20240605; b=b30zxqw7mEO9XJN637NX/Khmq4/PozOKkD6ycclv3uU9hOXkCP3YpSN86zjq1Ut5xz 3iJqjjvbZNLzESX9tEBQ93h6Z/8Ti0q7PiNP7ikNjX09gWusHT02d+7O+eELCJQhQEdH 8hGEBcMY+xjj7QnEiz7jKOoiey7vABsWkegisc+EoYTmGnmL6pFAX2OKs8bUYBHS18NL Wao9h0av/VwEZeaKBopzRB3TFU9xUAH/9umRptCdMqoHJj6aXmZmlrVE/mBUaQriAonH JLWM3fBzLlixISY9OG4ZPNljWAUz5+EOpDQMs/5Idsx6HPwMm1L71O5tUJEzzg5sBT1+ +LbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZKOWbb20GzaWViJCYCMGVE7QQHD6NpPs0mODaZFN3y8=; fh=nI7IAuFo56hSkH9x8qW4oXF6AtA6ljL94CJmshtxMnA=; b=j5hVRQupresm+fzky3ieqrMe7DyHku96IUNuvxvtay2n2YsS4Bum2M1hx+OaZpskA1 PVfdQN2gC728aTnkIp0FSqKA/vUmtZZwrAU64vntYBsrhlAaR72eAnn6+usFjnrGcT9S FxvqC34eEdoyPDgTHePlNI+D0BSPkT0E6Vn1iOqkET3FFn5rbSwsrgQta5ZRZCe7se26 +WewL0Hp47aMD6D+A/h5RUyANR1ebfsNEdpSJs3gpNZDIe14PJCBi44D8kcQivtE8SL9 8zhEUL0A9asiNLMVHzIDcUZHupdZ3GiQ6ikXz1SB/gdFb02BE2EcKOzWYoZd8KPnnrnX 6ghg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1776895820; x=1777500620; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZKOWbb20GzaWViJCYCMGVE7QQHD6NpPs0mODaZFN3y8=; b=mExJlu197VEvdF/QjSHiiAB/Kc48+rsWR4JalpoN6rmONTJzY7yj55TVie8ForhEoC uwmmXIp5uB43pbOKgzZWkhr75ZBg5NeSk2bMmSEfWosr/AhAqVjQnF4Llxk09dTFR+YN 7ln6uMg5h5HOLy+hqiX2tOKPVZMIECQ1WpZIC3SmBt9POFjUdyHRuAQeiflrQ3Ms4bvb BMWjtHfd26AF+JbgiqUNJ7g7eV99U49gMJ+s3GzxfXMwhnIUMlHmUgmuQwmcMJFH7a3N XjoLt8Kv6cmh0B20vX6ckTbw9tQBApYWdVTvojQph43YZpP3EiPvc7YgT5Upz/SOIPUC pVrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776895820; x=1777500620; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZKOWbb20GzaWViJCYCMGVE7QQHD6NpPs0mODaZFN3y8=; b=A6eJotJQzVz/n0az5yOpCJnIbRQQTLkshU812w7S5gxFcHYVgvtdXBfE8zAr5xx4OC JmbRwvjH3rm/3e0ZlKHD4TsZfqf8oknGowMjMV9BkxxD+FKdOeifIpAcpM7Osn3tMC3l L5cm3So6i8f6AOFfpv5Bd0KIuJTH/OZgovKftl0J4OXj9Eh24p3VyK/SMEnAAl4HQfsX xvXzXH3OyaAm/kGLMsZ+VGl3EJbkTC0nav/TdFHaQoOoUDCl2zFyZDtGI0ysoZedgpdb BgqKYu0jLVHLDoYWTucHbnG74gzXw3CQgE5KYr4ci2BNjvYMktHwuAffmnnw3IBJvwBs eyog== X-Gm-Message-State: AOJu0YyOCulQiqYHQ0gsx0QvmottIFukHRUgJwzOKSkFecAJwdOK11cN ZwNGcJAT9A69XYF0EPGkwzytsnUAC/hsqIaHFwNsMxhKf2daykRiTtTKCva7PNrmPbLMWA+oMdw RygzKlR/V0dx9s8PnGpH2leHifCvsSBRMCKxG3smRvn2O5+vGR2JWkg== X-Gm-Gg: AeBDiev0n87CRg5oWVXEbXD6Ld/yKgRv9Sho6OCUTcyK+RVzRocbUtCRxVjIzk+dbNM 3EtaeOguDB+K6ujeHK5t0opq4E22jMB9MbXQDPWlHsvi1o4nNqwOxzfJ3UNY2b8yvj4u9AE8Cko TqPyTXteAVK1McQfsVjchuuwUY5yXwFI3pQs9q4yFJIA1ZWF1vpD8F5MnmxEjtNIS/JsU98b//Y YtKfuZBZmn7xnVJ5ydJzn8YrT1qV8EQBGUZiFqqZeNZkczW9iK9dw/mjqsYkd6IrMnPb7S54nd1 7Mm9gEqets/KozUeoZuO X-Received: by 2002:a0c:f08e:0:b0:8ac:b63e:72eb with SMTP id 6a1803df08f44-8b0280086c6mr352851226d6.12.1776895819965; Wed, 22 Apr 2026 15:10:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jacob Champion Date: Wed, 22 Apr 2026 15:10:07 -0700 X-Gm-Features: AQROBzD6eSgv9XcJRv1dMMCKVZmd_eTF1Rz_bRfxme3ecNVH86hMihiitXlEegA Message-ID: Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times To: Nico Williams Cc: PostgreSQL Hackers , Daniel Schreiber Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 22, 2026 at 12:22=E2=80=AFPM Nico Williams 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