Skip to content

Vendor OpenSSL for the fuzz build to survive apt mirror outages - #362

Draft
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
dev/saurabh/fuzz-crash-fix-1fd
Draft

Vendor OpenSSL for the fuzz build to survive apt mirror outages#362
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
dev/saurabh/fuzz-crash-fix-1fd

Conversation

@saurabh500

@saurabh500 Saurabh Singh (saurabh500) commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

The scheduled GH-Rust Fuzz Test pipeline (ADO definitionId 2207) had failing runs on 2026-08-19 (builds 167989, 168079, 168173) that were not fuzz crashes. They failed because the Linux dependency install (scripts/install-deps.sh) could not reach the Ubuntu apt mirror (azure.archive.ubuntu.com, connection timed out) across all 5 retries, so pkg-config and libssl-dev were never installed. mssql-tds links system OpenSSL on Linux (via native-tls and a direct openssl dependency), so openssl-sys 0.9.117 failed to build and the fuzz target binaries never compiled.

Evidence from build 167989 (Run Fuzzer step):

cargo:warning=Could not find directory of OpenSSL installation ...
... `libssl-dev` on Ubuntu ...
... requires the `pkg-config` utility ... `pkg-config` could not be found.
openssl-sys = 0.9.117
Error: failed to build fuzz script: ... "cargo" "build" ... "--bin" "fuzz_tds_client"
No artifacts directory found

FuzzCrashesFound was false on every run and "Prepare Crash Artifacts" was skipped, so no crash artifact was produced — libFuzzer never ran because the harness didn't compile.

Change

Build OpenSSL from vendored source for the fuzz crate only, by adding openssl = { version = "0.10.66", features = ["vendored"] } scoped to non-Windows/non-macOS targets in mssql-tds/fuzz/Cargo.toml. This makes openssl-sys (shared by both native-tls and the direct openssl dependency) compile from source, so the fuzz build no longer needs libssl-dev/pkg-config from apt. Only a C compiler and perl are required, both already present on the CI image.

Scoped to the fuzz crate (publish = false); the shipped mssql-tds library build is unchanged.

Testing

  • cargo metadata in mssql-tds/fuzz confirms the manifest resolves and the vendored openssl dependency is correctly scoped to Linux/other non-macOS Unix targets.
  • Full cargo fuzz compilation is Linux/nightly-only and will be validated by the pipeline.

Related work item

Fixes AB#47487

The scheduled fuzz pipeline builds fuzz targets that link system OpenSSL
via mssql-tds (native-tls plus the direct openssl dependency). When the
Ubuntu apt mirror is transiently unreachable, libssl-dev and pkg-config
can't be installed and openssl-sys fails to build, failing the fuzz runs
with no crash (FuzzCrashesFound=false). Build OpenSSL from vendored
source for the fuzz crate only so the harness compiles without system
libssl-dev/pkg-config; the shipped library build is unchanged.

AB#47487

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant