Re: libpq crashing on macOS during connection startup

From: John DeSoi <john(at)desoi(dot)dev>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: libpq crashing on macOS during connection startup
Date: 2023-12-01 01:26:58
Message-ID: 0100018c22fc6f53-68a3de31-0c8c-4305-a889-fb23b5732596-000000@email.amazonses.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Nov 30, 2023, at 2:07 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> What troubles me about that stack trace is the references to Heimdal.
> We gave up supporting Heimdal (and v16 explicitly rejects building
> with it) because its support for Kerberos credentials was too
> incomplete and flaky. So I'm inclined to guess that you are running
> into some Heimdal bug. Try to rebuild libpq using MIT Kerberos
> and see if things get better.

I'm using v16 on my development machine and it is crashing on me at times with the same backtrace. Restarting the web server fixes it for a while for some reason.

Is there a way to simply disable GSSAPI authentication? I could not find it.

The builds are from homebrew (https://brew.sh/). I'll have to see if there is a way for me to override build options.

The otool output below shows that Apple's Kerberos is being used and I assume by extension, their Heimdal library. The Heimdal project told me as much - Apple has a fork and would not pull from their project.

John DeSoi, Ph.D.

$ otool -L /usr/local/opt/postgresql(at)16/lib/libpq.5.dylib
/usr/local/opt/postgresql(at)16/lib/libpq.5.dylib:
/usr/local/opt/postgresql(at)16/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.16.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
/usr/local/opt/openssl(at)3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/local/opt/openssl(at)3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/local/opt/krb5/lib/libgssapi_krb5.2.2.dylib (compatibility version 2.0.0, current version 2.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)

$ otool -L /usr/local/opt/krb5/lib/libgssapi_krb5.2.2.dylib
/usr/local/opt/krb5/lib/libgssapi_krb5.2.2.dylib:
/usr/local/opt/krb5/lib/libgssapi_krb5.2.2.dylib (compatibility version 2.0.0, current version 2.2.0)
@loader_path/libkrb5.3.3.dylib (compatibility version 3.0.0, current version 3.3.0)
@loader_path/libk5crypto.3.1.dylib (compatibility version 3.0.0, current version 3.1.0)
@loader_path/libcom_err.3.0.dylib (compatibility version 3.0.0, current version 3.0.0)
@loader_path/libkrb5support.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

$ otool -L /usr/local/opt/krb5/lib/libkrb5.3.3.dylib
/usr/local/opt/krb5/lib/libkrb5.3.3.dylib:
/usr/local/opt/krb5/lib/libkrb5.3.3.dylib (compatibility version 3.0.0, current version 3.3.0)
@loader_path/libk5crypto.3.1.dylib (compatibility version 3.0.0, current version 3.1.0)
@loader_path/libcom_err.3.0.dylib (compatibility version 3.0.0, current version 3.0.0)
@loader_path/libkrb5support.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-12-01 01:53:51 Re: libpq crashing on macOS during connection startup
Previous Message Atul Kumar 2023-11-30 23:42:50 Re: replication strange behavior