Add a MemorySanitizer CI job for the offline engine self-tests#433
Merged
Conversation
MSan is the only sanitizer that catches a read of uninitialized memory -- the class of #143, where the size filter tested an uninitialized stack LLint and forbade files at random. ASan and UBSan let that through. MSan reports any byte produced by an uninstrumented library as uninitialized, so the job stays inside our own code: clang, a static link (the MSan runtime is not injected into shared objects), --disable-https to drop openssl, and only the offline 01_engine-* self-tests minus the zlib-backed cache trio. Those self-tests drive the hostile-input parsers (charset, mime, html, entities, idna, filters) straight through MSan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MemorySanitizer is the only sanitizer that catches a read of uninitialized memory, the bug behind #143: the size filter tested an uninitialized stack value and forbade files at random. ASan and UBSan miss that class entirely, so nothing guards against a regression deterministically today.
MSan treats any byte written by an uninstrumented library as uninitialized, so the job is scoped tightly: clang with a static link (the MSan runtime isn't injected into shared objects),
--disable-httpsto drop openssl, and only the offline01_engine-*self-tests minus the zlib-backed cache trio. Those tests push the hostile-input parsers (charset, mime, HTML, entities, IDNA, filters) straight through MSan. A full-crawl run would need instrumented builds of zlib and openssl, fragile infrastructure for paths ASan+UBSan already cover.Validated locally: the 19 selected tests pass clean, and reintroducing #143's bug makes MSan pinpoint the uninitialized read and fail the test.