Skip to content

fix(fuzz): fall back to fs operator so fuzz targets produce real coverage#7723

Open
tonghuaroot wants to merge 4 commits into
apache:mainfrom
tonghuaroot:fix-fuzz-noop
Open

fix(fuzz): fall back to fs operator so fuzz targets produce real coverage#7723
tonghuaroot wants to merge 4 commits into
apache:mainfrom
tonghuaroot:fix-fuzz-noop

Conversation

@tonghuaroot

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7722.

Rationale for this change

All OSS-Fuzz targets exit immediately when OPENDAL_TEST is unset because init_test_service() returns None. OSS-Fuzz never sets this variable, so coverage has been stuck at 0.26% (harness startup only) since integration.

What changes are included in this PR?

  • fuzz_reader.rs / fuzz_writer.rs: replace the if let Some(op) early-return with a LazyLock<Operator> that falls back to a local Fs operator in a temp directory when no test service is configured.
  • fuzz/Cargo.toml: enable services-fs feature so the fallback compiles.
  • New fuzz_path.rs target: feeds arbitrary strings as paths through write/stat/list/copy/rename/delete — already found a real bug (fix(services/fs): preserve backslash in filenames on Unix during list #7721) within 2 minutes of running.

Are there any user-facing changes?

No. Changes are limited to the core/fuzz/ directory which is only used by cargo fuzz and OSS-Fuzz.

AI Usage Statement

Claude was used for assistance with fuzz target development.

@tonghuaroot tonghuaroot requested a review from Xuanwo as a code owner June 10, 2026 10:14
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Jun 10, 2026
Comment thread core/fuzz/Cargo.toml
log = { workspace = true }
logforth = { workspace = true }
opendal = { path = "..", features = ["tests"] }
opendal = { path = "..", features = ["tests", "services-fs"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! Do we need a fallback since we could always exit 1 and warn the user in fuzzer test? Because a test failure will force us to check CI status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: OSS-Fuzz targets have had no effective coverage since integration

2 participants