Repository navigation
Do not bundle a copy of OpenSSL into the delta-kernel Rust archive - #123889
Conversation
With `OPENSSL_LIBS=ssl:crypto` and `OPENSSL_STATIC=1`, the `openssl-sys` build script emits `cargo:rustc-link-lib=static=ssl` and `static=crypto`, so rustc bundles the CMake-built `libssl.a` and `libcrypto.a` into the `openssl-sys` rlib and from there into `libdelta_kernel_ffi.a`. That archive precedes `libssl.a`/`libcrypto.a` on every link, so the binary takes OpenSSL from it. Neither cargo nor sccache re-keys the archive when only the bundled native objects change (cargo tracks env vars and the include dir for openssl-sys), so it can keep OpenSSL objects from an older build. After ClickHouse#123738 dropped the SanitizerCoverage PC table from the fuzzer build, the archive still held OpenSSL objects compiled with it: every fuzzer that links `dbms` got a PC table covering OpenSSL only (85087 entries vs 1.8M-11.8M inline counters), and libFuzzer aborted at startup with "The size of coverage PC tables does not match the number of instrumented PCs" (18 of 19 fuzzers in WeeklyFuzzersCorpus on 22e115e). The same mechanism made the master release build of the OpenSSL 3.5.8 bump (07c5bfb) link 3.5.7 code. With an empty `OPENSSL_LIBS`, openssl-sys emits no link directive, nothing is bundled, and the Rust objects' OpenSSL references resolve from `OpenSSL::SSL`/`OpenSSL::Crypto`, which `delta_kernel_ffi` already links as INTERFACE libraries. Removing the directive changes openssl-sys's metadata, so the dependent crates and the staticlib are rebuilt on the first build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 major, 1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261004-190022 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261004-170800 |
|
Workflow [PR], commit [2132b45] Summary: ✅
AI ReviewSummaryThis PR changes Missing context / blind spots
Final Verdict
LLVM Coverage ReportMeasured on commit 2132b45.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +239 lines in 60 files (-82 lines lost coverage) · Details |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
Related: #123738
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
delta-kernel-rslibrary no longer carries its own copy of OpenSSL, so the binary always links the OpenSSL built fromcontrib/opensslwith the current build flags, instead of an older copy kept by the Rust build cache.Description
Since #123738, 18 of 19 fuzzers abort at startup on master with
The size of coverage PC tables does not match the number of instrumented PCs(WeeklyFuzzersCorpus report). Onlylexer_fuzzer, which does not link OpenSSL, passes.Root cause: with
OPENSSL_LIBS=ssl:crypto,openssl-sysmakes rustc bundle the CMake-builtlibssl.a/libcrypto.aintolibdelta_kernel_ffi.a. That archive comes first on the link line, so the binary takes OpenSSL from it. Neither cargo nor sccache re-keys the archive when only the bundled native objects change, so it keeps old OpenSSL objects: here, objects compiled before #123738 that still have a PC table. The fuzzers' only PC table is therefore OpenSSL's (85087 entries innames_and_types_fuzzer, against 1.8M inline counters). The same staleness shows in the master release build of the OpenSSL 3.5.8 bump (07c5bfb5): itsOpenSSL_version_numreturns 3.5.7.Change:
OPENSSL_LIBSis empty, so nothing is bundled and the Rust objects resolve OpenSSL fromOpenSSL::SSL/OpenSSL::Crypto, whichdelta_kernel_ffialready links.Validation with the CI
amd_fuzzersconfiguration: a stale archive reproduces CI's exact counts (names_and_types_fuzzer1828871 counters / 85087 PCs,compressed_buffer_fuzzer7325301 / 85432) and the abort. With the change the archive has no OpenSSL objects, the fuzzers have no PC table, and-runs=0,-merge=1and 60 s of fuzzing pass. The debug binary links one OpenSSL (3.5.8), and the delta-lake stateless tests pass.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/123889]
Version info
26.10.1.1544-master(included in26.10and later)