Skip to content

Load zlib by its macOS name on macOS - #17

Merged
atgreen merged 1 commit into
atgreen:masterfrom
burinc:fix/macos-zlib-name
Oct 18, 2026
Merged

atgreen merged 1 commit into
atgreen:masterfrom
burinc:fix/macos-zlib-name

Conversation

@burinc

@burinc burinc commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

%load-zlib always loads "libz.so.1", the Linux name. macOS has no such file: its zlib is libz.1.dylib, in dyld's shared cache. So on macOS the first java.util.zip native call (CRC32, Deflater, Inflater, GZIP) signals "Error opening shared object". That's a Lisp error, so Java's catch (Throwable) can't stop it. The fix picks the name with #+darwin, and Linux is unchanged.

On macOS this is only reachable with #16, because loading java.util.zip first goes through BootLoader.loadLibrary. With both, CRC32, Deflater/Inflater and a GZIP round trip match the JVM, and the new aaa/zlib.java (CRC32 plus a GZIP round trip) passes. It fails with #16 alone. aaa/ni.java gets past zlib now and then needs #18 (VM.getNanoTimeAdjustment). With #16, #17 and #18 together, make check-regression passes on macOS: 501 core passes against a baseline of 492. macOS arm64, SBCL 2.6.9, JDK 25.0.2.

%load-zlib always loaded "libz.so.1", the Linux name, so on macOS the
first java.util.zip native call (CRC32, Deflater, Inflater, GZIP and
zip streams) signalled "Error opening shared object". That is a Lisp
error rather than a Java exception, so a catch in Java code could not
stop it. On macOS the system zlib is libz.1.dylib, served from dyld's
shared cache. aaa/zlib.java checks a CRC32 and a GZIP round trip.
burinc added a commit to jlt-commons/jolt-openldk that referenced this pull request Oct 14, 2026
@atgreen
atgreen merged commit 7599acc into atgreen:master Oct 18, 2026
atgreen added a commit that referenced this pull request Oct 18, 2026
PRs #16, #17 and #18 each added a testsuite case (aaa/digest, aaa/zlib,
aaa/instant).  check-regression.sh only fails on lost passes and new
failures, so a new test is not actually enforced until it is in the
baseline.  Core suites now 501 expected passes, up from 492; no test
changed state.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants