Closed acole42 closed 5 months ago
What's also odd is if I used either the arm64_ventura bottle of krb5 or brew install --build-from-source krb5
I run into the segfault issue. Yet if I download krb5-1.21.2 and compile the libraries separately using the same flags as brew and inject the compiled libraries into DYLD_LIBRARY_PATH
I don't run into the segfault issue.
~/Projects/krb5-1.21.2/src ❯ ./configure
--disable-debug \
--disable-dependency-tracking \
--prefix=/opt/homebrew/Cellar/krb5/1.21.2 \
--libdir=/opt/homebrew/Cellar/krb5/1.21.2/lib \
--disable-nls \
--disable-silent-rules \
--without-system-verto \
--without-keyutils
❯ make
❯ DYLD_LIBRARY_PATH=$HOME/Projects/krb5-1.21.2/src/lib DYLD_PRINT_LIBRARIES=1 psql -h 127.0.0.1 -d postgres 2>&1 | egrep "krb5|libpq"
dyld[64127]: <15D9A190-BFBD-395C-8EA0-8ACFABB691DF> /opt/homebrew/Cellar/postgresql@14/14.12/lib/postgresql@14/libpq.5.14.dylib
dyld[64127]: <E2647C09-805E-348D-B795-4A109272481E> ~/Projects/krb5-1.21.2/src/lib/gssapi/libgssapi_krb5.2.2.dylib
dyld[64127]: <4A29A8C7-9A5B-3FB9-98FB-3DFDBF6EC43E> ~/Projects/krb5-1.21.2/src/lib/krb5/libkrb5.3.3.dylib
dyld[64127]: <3D7EA99D-B924-3082-934F-32667A2271AE> ~/Projects/krb5-1.21.2/src/lib/crypto/libk5crypto.3.1.dylib
dyld[64127]: <A6C7A90F-BF45-32E5-9CF7-9D2940CE025E> ~/Projects/krb5-1.21.2/src/util/et/libcom_err.3.0.dylib
dyld[64127]: <0926D154-AE40-32DD-8043-44096D720683> ~/Projects/krb5-1.21.2/src/util/support/libkrb5support.1.1.dylib
psql (14.12 (Homebrew))
Type "help" for help.
postgres=#
Could you share the link from doing
brew install --build-from-source krb5
brew gist-logs krb5
?
Maybe https://krbdev.mit.edu/rt/Ticket/Display.html?id=9103 based on stack trace?
If so, could try https://github.com/krb5/krb5/commit/635c8cca65b745476d07c1f5ff701445db25c10d
@carlocab Here's the output from the requested commands.
❯ brew install --build-from-source krb5
==> Fetching krb5
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/f9e9b8fb55aef222c500f8a94a948b3c437afe67/Formula/k/krb5.rb
##################################################################################################################################################################### 100.0%
==> Downloading https://kerberos.org/dist/krb5/1.21/krb5-1.21.2.tar.gz
Already downloaded: ~/Library/Caches/Homebrew/downloads/36ed7af4db98b395a891105a34041859cec149be294a1dc35492d16153b905c9--krb5-1.21.2.tar.gz
==> ./configure --disable-nls --disable-silent-rules --without-system-verto --without-keyutils
==> make
==> make install
==> Caveats
krb5 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have krb5 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/krb5/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/krb5/sbin:$PATH"' >> ~/.zshrc
For compilers to find krb5 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/krb5/lib"
export CPPFLAGS="-I/opt/homebrew/opt/krb5/include"
For pkg-config to find krb5 you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/krb5/lib/pkgconfig"
==> Summary
🍺 /opt/homebrew/Cellar/krb5/1.21.2: 163 files, 5.1MB, built in 49 seconds
==> Running `brew cleanup krb5`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
❯ psql -d postgres -h 127.0.0.1
[1] 49904 segmentation fault psql -d postgres -h 127.0.0.1
brew gist-logs krb5
https://gist.github.com/acole42/298db6f4f2f4de36047eb4e4790e51ad
@cho-m
I compiled the latest commit from the master branch on krb5/krb5 which included https://github.com/krb5/krb5/commit/635c8cca65b745476d07c1f5ff701445db25c10d. When I injected the compiled libraries in DYLD_LIBRARY_PATH
I didn't encounter the segfault. It seems like that commit fixes the bug.
I'm still puzzled why compiling the same version (krb5-1.21.2 ) as the krb5 formula, which doesn't have the referenced fix https://github.com/krb5/krb5/commit/635c8cca65b745476d07c1f5ff701445db25c10d, works fine if I compile it separately without brew but segfaults when I have brew compile the library.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Run
psql
to connect to a postgres DB using TCP.What happened (include all command output)?
Segfaults when trying to connect to a postgres DB with psql using TCP using the linked krb5. Seems similar to #135170 but I'm unable to post to that issue since it was marked stale.
What did you expect to happen?
Connect to the database without segfaulting.
Step-by-step reproduction instructions (by running
brew
commands)