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/printf: exit code differs #5777

Closed
oss-fuzz-robot opened this issue Jan 3, 2024 · 2 comments · Fixed by #5782
Closed

fuzzing/printf: exit code differs #5777

oss-fuzz-robot opened this issue Jan 3, 2024 · 2 comments · Fixed by #5782

Comments

@oss-fuzz-robot
Copy link

OSS-Fuzz has found a bug in this project. Please see https://oss-fuzz.com/testcase?key=5970261954330624 for details and reproducers.

This issue is mirrored from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65496 and will auto-close if the status changes there.

If you have trouble accessing this report, please file an issue at https://github.com/google/oss-fuzz/issues/new.

@sylvestre
Copy link
Sponsor Contributor

hmm, i wonder if this isn't a thread issue here

	Test completed with discrepancies for printf: ["%x", "%786"]
	Running test ["printf", "%b", "842"]
	Test Type: printf
	Input: ["%b", "842"]
	Rust exit code: 1
	GNU exit code: 0
	Discrepancy detected: exit code differs

@sylvestre sylvestre changed the title OSS-Fuzz issue 65496 fuzzing/printf: exit code differs Jan 3, 2024
@samueltardieu
Copy link
Contributor

If you run the fuzzers, you'll see that it happens in a test which runs just after an unsuccessful (but matching) test has been executed. This led me to explore whether you might use global variables somewhere, and you do… for the exit code (amongst others).

I think this is a very bad idea to do so, and the most sensible plan would be to eliminate all global state. I'll submit a PR nontheless so that the fuzzer does not crash on it. Note that this would still not allow multi-threaded fuzzers to run correctly, but I don't know if those exist (most will create multiple processes).

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

Successfully merging a pull request may close this issue.

4 participants