Skip to content

add a sed fuzzer#72

Merged
cakebaker merged 7 commits intouutils:mainfrom
sylvestre:fuzz
Aug 25, 2025
Merged

add a sed fuzzer#72
cakebaker merged 7 commits intouutils:mainfrom
sylvestre:fuzz

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

far from perfect

Currently:

  • stalled very quickly
  • not executed in the CI
  • duplicated code of the fuzz_common functions from the coreutils (i will create a crate for this like uutests)

but found:
#71

Comment thread fuzz/fuzz_targets/fuzz_sed.rs
Comment thread fuzz/fuzz_targets/fuzz_sed.rs
Comment thread fuzz/fuzz_targets/fuzz_sed.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (fd9923f) to head (c29a15f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #72   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         13      13           
  Lines       2729    2729           
  Branches     240     240           
=====================================
  Misses      2729    2729           
Flag Coverage Δ
macos_latest 0.00% <ø> (ø)
ubuntu_latest 0.00% <ø> (ø)
windows_latest 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -0,0 +1,264 @@
name: Fuzzing
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

more or less what we have in rust coreutils

@sylvestre
Copy link
Copy Markdown
Contributor Author

to run it:
cargo +nightly fuzz run fuzz_sed -- -max_total_time=1 -timeout=2 -detect_leaks=0 -print_final_stats=1

Comment thread fuzz/Cargo.toml Outdated
Comment thread fuzz/fuzz_targets/fuzz_common/mod.rs Outdated
sylvestre and others added 2 commits August 24, 2025 14:22
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Comment on lines +42 to +59
pub fn is_gnu_cmd(cmd_path: &str) -> Result<(), std::io::Error> {
CHECK_GNU.call_once(|| {
let version_output = Command::new(cmd_path).arg("--version").output().unwrap();

println!("version_output {version_output:#?}");

let version_str = String::from_utf8_lossy(&version_output.stdout).to_string();
if version_str.contains("GNU coreutils") {
IS_GNU.store(true, Ordering::Relaxed);
}
});

if IS_GNU.load(Ordering::Relaxed) {
Ok(())
} else {
panic!("Not the GNU implementation");
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function probably doesn't work as expected as it relies on coreutils.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i am planning to move this into a crate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread fuzz/fuzz_targets/fuzz_common/pretty_print.rs Outdated
Comment thread fuzz/fuzz_targets/fuzz_sed.rs Outdated
Comment thread fuzz/fuzz_targets/fuzz_sed.rs Outdated
sylvestre and others added 3 commits August 25, 2025 09:25
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@cakebaker cakebaker merged commit a4606a5 into uutils:main Aug 25, 2025
18 checks passed
@sylvestre sylvestre deleted the fuzz branch December 22, 2025 09:51
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.

3 participants