Skip to content

Re-enables FuzzParseDoc - #37

Merged
redvers merged 1 commit into
mainfrom
test/reenable-fuzz-parsedoc
May 22, 2026
Merged

Re-enables FuzzParseDoc#37
redvers merged 1 commit into
mainfrom
test/reenable-fuzz-parsedoc

Conversation

@redvers

@redvers redvers commented May 22, 2026

Copy link
Copy Markdown
Collaborator

The original FuzzParseDoc property was removed when crash-resistance fuzz tests were added (PR #32) because feeding arbitrary byte strings to Xml2Doc.parseDoc triggered cumulative state corruption inside libxml2 - a segfault or "free(): invalid pointer" abort after ~5-10 distinct failed parses. The crash was cumulative across inputs but did not reproduce when the same input was reparsed in a loop, suggesting state buildup in libxml2's internal error context across failed parses.

PR #36 (errors-as-data refactor) routes parse failures through Xml2Error.from_last_error, which calls xmlResetError after reading the per-thread last-error. This appears to clear the state buildup that previously caused the corruption.

Re-enabling the property with the default 100-sample budget. Five consecutive make test runs (500 distinct failed-parse attempts) complete without incident, well past the original ~5-10 crash threshold. The crash-resistance contract is back in force for the parse path.

No release note: test-only change, follows PR #32 / #22 precedent of not generating CHANGELOG entries for test additions.

The original FuzzParseDoc property was removed when crash-resistance
fuzz tests were added (PR #32) because feeding arbitrary byte strings
to Xml2Doc.parseDoc triggered cumulative state corruption inside
libxml2 - a segfault or "free(): invalid pointer" abort after ~5-10
distinct failed parses. The crash was cumulative across inputs but
did not reproduce when the same input was reparsed in a loop,
suggesting state buildup in libxml2's internal error context across
failed parses.

PR #36 (errors-as-data refactor) routes parse failures through
Xml2Error.from_last_error, which calls xmlResetError after reading
the per-thread last-error. This appears to clear the state buildup
that previously caused the corruption.

Re-enabling the property with the default 100-sample budget. Five
consecutive `make test` runs (500 distinct failed-parse attempts)
complete without incident, well past the original ~5-10 crash
threshold. The crash-resistance contract is back in force for the
parse path.

No release note: test-only change, follows PR #32 / #22 precedent
of not generating CHANGELOG entries for test additions.
@redvers
redvers merged commit ac21700 into main May 22, 2026
6 checks passed
@redvers
redvers deleted the test/reenable-fuzz-parsedoc branch May 22, 2026 04:17
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