pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John DeSoi <john@desoi.dev>
Cc: Joe Conway <mail@joeconway.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: libpq crashing on macOS during connection startup
Date: Fri, 01 Dec 2023 12:02:43 -0500
Message-ID: <116315.1701450163@sss.pgh.pa.us> (raw)
In-Reply-To: <0100018c25ba1137-7735f30f-0938-458b-992b-60369d534db0-000000@email.amazonses.com>
References: <0100018c20b152e0-ec85ac20-b379-46d7-a962-c59e00f3201c-000000@email.amazonses.com>
	<96e41ee8-a1b6-4bf9-82b5-1c0fd2d5502a@joeconway.com>
	<0100018c20c97a5e-2aa47402-cd8c-4548-bbd3-b17d10020b39-000000@email.amazonses.com>
	<508800.1701374869@sss.pgh.pa.us>
	<0100018c22fc6f53-68a3de31-0c8c-4305-a889-fb23b5732596-000000@email.amazonses.com>
	<12250.1701395631@sss.pgh.pa.us>
	<0100018c25ba1137-7735f30f-0938-458b-992b-60369d534db0-000000@email.amazonses.com>

John DeSoi <john@desoi.dev> writes:
>> On Nov 30, 2023, at 7:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Ugh, not only Heimdal but a very obsolete version thereof?  It borders
>> on negligence for the homebrew PG package to be building against that.
>> They should be pulling in homebrew's MIT Kerberos package and using
>> that, if they want to enable GSSAPI.

> I was looking at the homebrew source for PostgreSQL package to see if there was a way to customize the build options. I did not find one but saw the comment below. Apparently this is a known issue and it was suggested to use the MIT Kerberos package 4 years ago. Instead they just added this comment in 2020.

> # GSSAPI provided by Kerberos.framework crashes when forked.
> # See https://github.com/Homebrew/homebrew-core/issues/47494.

Oh, thanks for finding that.  But you misinterpreted the outcome;
the commit that closed that thread did

+# GSSAPI provided by Kerberos.framework crashes when forked.
+# See https://github.com/Homebrew/homebrew-core/issues/47494.
+depends_on "krb5"

The "depends_on" was evidently meant to force building against krb5,
and I suppose it did have that effect when committed.  Could they
have done something since then to break it?

Looking closer, your stack trace seems to show that libpq *is*
linked against MIT Kerberos: at least, control flows from
libpq.5.dylib to libgssapi_krb5.2.2.dylib, which is not a
library that Apple supplies.  However, then a few subroutines
further deep, we somehow end up in Apple's Kerberos framework,
and that eventually calls libdispatch which is the source of
the problem according to the discussion in issues/47494.

My guess at this point is that somebody at Homebrew put in a
hack (perhaps quite recently) that causes their build of MIT
Kerberos to sometimes call Apple's implementation, and that
ill-advised idea has re-opened the problem that issues/47494
meant to solve.

I'd suggest filing a bug against Homebrew's krb5 package.
Whatever this is, it seems pretty clear that it's not a
Postgres bug.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <116315.1701450163@sss.pgh.pa.us>
Permalink:  ../116315.1701450163@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/116315.1701450163@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john@desoi.dev, mail@joeconway.com
  Subject: Re: libpq crashing on macOS during connection startup
  In-Reply-To: <116315.1701450163@sss.pgh.pa.us>
  References: <0100018c20b152e0-ec85ac20-b379-46d7-a962-c59e00f3201c-000000@email.amazonses.com> <96e41ee8-a1b6-4bf9-82b5-1c0fd2d5502a@joeconway.com> <0100018c20c97a5e-2aa47402-cd8c-4548-bbd3-b17d10020b39-000000@email.amazonses.com> <508800.1701374869@sss.pgh.pa.us> <0100018c22fc6f53-68a3de31-0c8c-4305-a889-fb23b5732596-000000@email.amazonses.com> <12250.1701395631@sss.pgh.pa.us> <0100018c25ba1137-7735f30f-0938-458b-992b-60369d534db0-000000@email.amazonses.com> <116315.1701450163@sss.pgh.pa.us>

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

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