-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Improve fuzzing tests #109
Comments
experts is strong 😉
|
Awesome, I will look into that and try those out in a new PR. Do the fuzzing tests use libFuzzer and is that where the options are documented? https://llvm.org/docs/LibFuzzer.html#options |
Ah exactly what I wanted! More cases printed 🎉: https://github.com/kaleidawave/ezno/actions/runs/7713102547/job/21022255510 good for fixing the current issues. Once green then can go back to short-circuited version. |
If you want to be a bit experimental: try the following replacement in fuzz/Cargo.toml: diff --git a/parser/fuzz/Cargo.toml b/parser/fuzz/Cargo.toml
index 2abb8b9..7caea01 100644
--- a/parser/fuzz/Cargo.toml
+++ b/parser/fuzz/Cargo.toml
@@ -18,7 +18,7 @@ boa_ast = { git = "https://github.com/boa-dev/boa.git", features = [
boa_interner = { git = "https://github.com/boa-dev/boa.git", features = [
"arbitrary",
] }
-libfuzzer-sys = "0.4"
+libfuzzer-sys = { git = "https://github.com/AFLplusplus/LibAFL.git", branch = "libfuzzer-best", package = "libafl_libfuzzer" }
pretty_assertions = "1.3.0"
proc-macro2 = "1.0.66" This uses the libafl_libfuzzer which we have since stabilised. It'll spit out some maybe undesirable backtraces, but it finds things way faster than libfuzzer. |
Is it a bug that Also what does each part of this tracing line mean?
Does one of these numbers display how many fuzzing runs it has completed? |
Huh, curiously, it seems that forking mode output doesn't have any documentation. Let me explain this piecewise. The Let's break apart the line you asked about:
|
Nice! so
That is what I thought. Do you know why they are not logged at the end of the test then? (it is under the |
No, it means that it's launched 31 individual instances. You only ever have one running at a time, but libfuzzer may stop "jobs" and start new ones if e.g. there is persistent memory detected, if the job crashes, or for other mysterious internal reasons. |
It seems that |
Sadly no easy way around it, and it seems that the exit code is determined by the exit code of the last exited job -- which may or may not be 0. However, you can add the following POSIX-compatible snippet to the end of your test to just dump the output: if test -d fuzz/artifacts; then find fuzz/artifacts -type f -print -exec xxd {} \; -exec cargo fuzz fmt -s none module_roundtrip_structured {} \;; false; fi |
Ah I think I understand 👍 will try that in the future. That probably explains my confusion when I wondered why running for 10 minutes (with |
The fuzzing of the parser is really good 🎉 some of the errors found in the parser so far:
[2,,3]
is valid), but function arguments are not.x++ + 5
it is really important to have the whitespace between the++ +
asx+++5
is invalid and has ambiguous parsing.(function () { return 2 })
in statement position, the parenthesis need to be kept as otherwise it is parsed as a statement and it is invalid as it needs a name (similarly for object literals and class expression).However the fuzzing tests are still not passing. They are only really picking up extreme edge cases now , so it isn't urgent. I am hoping the fixes are near the end. But I was wondering if there could be some improvements:
parse -> render -> parse
(second parse) fail happens it showsinput
as what is mismatched. It is possible to print the first output as where the mismatch was. See action run here, I got confused at first as I thought the test was expected to match the input exactly (which is very difficult as it is just an AST parser)build.rs
should get from a specific fixed ref, rather than the main branch?Pinging @addisoncrump & @jasikpark the fuzzing experts
The text was updated successfully, but these errors were encountered: