Add 2 fuzzers for nu-path, nu-parser#10376
Conversation
There was a problem hiding this comment.
Please keep the rust-toolchain.toml, we use it to ensure the Rust version used by developers is compatible with the packaging "vendors".
Not sure about what is up with crates/nu-path/src/util.rs? Is this unlinked in the module tree?
If we land this into the tree it would be great to have a readme pointing to relevant documentation.
yes I mistakenly pushed other changes :D |
|
No problem! Thanks for sharing your work, this sounds helpful to have, great that you already found a problem through that. |
|
I think this is a great idea to introduce fuzzing. nu-path is a good place to start. Thanks! |
|
I added the README.md now. This pr is ready |
|
|
sholderbach
left a comment
There was a problem hiding this comment.
Haven't played with cargo-fuzz so far but the targets look good to me.
Will give it a try later :)
actually |
sholderbach
left a comment
There was a problem hiding this comment.
Running this seems to go smooth!
Already found something new that triggers an access out ouf bounds panic:
minimized-from-23616a49a67ddbe0e9e36ab7fa5b0fe9751a6d04.txt
$ nu artifacts/parse/minimized-from-23616a49a67ddbe0e9e36ab7fa5b0fe9751a6d04
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 3', /home/stefan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nu-parser-0.84.0/src/parser.rs:745:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
You'll find many :D |
There is no need to upload it for the regular users.
|
I just found a file that triggers a rapid memory leak, about 4 GB in a minute edit: It seems like it's caused by exponential memory use in the parser for tables. Here's a more minimal reproduction: I have now opened #10438 for it |
|
nice 😉 |
# Description This PR adds a fuzzer for the nu-path and the nu-parser crate. Now you can go to `crates/nu-path/fuzz`/`crates/nu-parser/fuzz` and run `cargo fuzz` to find crashes. nushell#10365 and nushell#9417 was found by this --------- Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
Description
This PR adds a fuzzer for the nu-path and the nu-parser crate.
Now you can go to
crates/nu-path/fuzz/crates/nu-parser/fuzzand runcargo fuzztofind crashes.
#10365 and #9417 was found by
this
User-Facing Changes
it doesn't affect user experience