Conversation
Add Go fuzz targets for the scrape parsers, response reader and target construction. A reused scraper kept the previous parse after invalid UTF-8; a negative __sample_limit__ wrapped and disabled the configured cap. Co-authored-by: Cursor <cursoragent@cursor.com>
Revert the production fixes, regression tests, seed testdata, nightly workflow and doc updates added on top of the fuzz targets. Only the fuzz targets and the shared corpus remain. Running these targets can rediscover the reverted issues: - scraper.h: UTF-8 validation before state reset (stale parse on invalid UTF-8 in a reused scraper) - target.go: negative __sample_limit__ not clamped (wraps to unsigned on the C++ side) Co-authored-by: Cursor <cursoragent@cursor.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.
What
Fuzz targets for the scrape ingestion path — the exposition-format parsers, hashdex reuse, a differential target against upstream's Go
textparse, the HTTP response reader, and target construction from discovered labels.FuzzPrometheusScraperHashdexParsepp/go/cppbridgeFuzzOpenMetricsScraperHashdexParsepp/go/cppbridgeFuzzScraperHashdexReusepp/go/cppbridgeFuzzScraperHashdexAgainstTextparsepp/go/cppbridgeFuzzReadResponsepp-pkg/scrapebody_size_limit, pooled readersFuzzTargetsFromGrouppp-pkg/scrape__sample_limit__Seed corpora and the libFuzzer dictionary are shared through
util/fuzzing/scrapecorpus(stdlib-only, so it doesn't drag PromQL test machinery into the cgo test binary).What this PR does not include
No production code changes, docs, CI workflow, or regression tests — just the fuzz targets and corpus, by request. Running these targets with
-fuzzcan rediscover real issues found during development:__sample_limit__annotation wrapped to unsigned on the C++ side and silently disabled the configured sample limitThese are left for a follow-up PR with the actual fixes.
How to run
From the
Dockerfile.ciimage (targets link against the C++ bindings):Every target also runs as an ordinary test over its seed corpus, so
go test ./pp/go/cppbridge/... ./pp-pkg/scrape/...exercises the seeds without-fuzz.Made with Cursor