Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzzing Running test ["seq", "-49.450798063728875", "3458"] is staled #5724

Closed
sylvestre opened this issue Dec 25, 2023 · 1 comment
Closed
Labels

Comments

@sylvestre
Copy link
Sponsor Contributor

cargo +nightly fuzz run fuzz_seq -- -max_total_time=600 -detect_leaks=0
freeze on:
Running test ["seq", "-49.450798063728875", "3458"]
rust-gdb -p shows that it is on:
write!(stdout, "{separator}")?;

write!(stdout, "{separator}")?;

i don't know what is going on ?!

cakebaker added a commit that referenced this issue Dec 25, 2023
Disable fuzzing seq until issue #5724 is fixed
@samueltardieu
Copy link
Contributor

It looks like fuzz_common::generate_and_run_uumain() in the fuzzing framework sets up pipes for stdout/stderr and reads them afterwards. However, the default pipe size on Linux is 16 pages, i.e. 64kiB on most systems. The output of seq -49.450798063728875 3458 is more than 70kiB, so the write size of the pipe will block until the pipe is read from, which never happens before the command completes.

I can see at least two ways to fix this:

  • limit the command output/error to 64kiB in any case
  • use two separate threads, one for running the command and one for reading its output

sylvestre added a commit to sylvestre/coreutils that referenced this issue Dec 31, 2023
cakebaker added a commit that referenced this issue Jan 4, 2024
* fuzz: use thread to bypass the limitation of output

Closes: #5724

many thanks to @samueltardieu

* fuzz: enable seq as the stalled issue is fixed

* fuzz: add 4 more fuzzers

* fuzz: enable the 4 new fuzzers in the CI

* remove old import

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* remove comment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* remove comment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* add more flags

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* add space

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* add a comment about sort local

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* wrong copy/paste

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* fuzz: import "std::env"

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants