Describe the bug
When you type a sequence of open square braces, the parser branches exponentially and uses exponentially more memory for each extra branch.
How to reproduce
- Type
[[[[[[[[[[[[[[[[[[[[[[[[ in nushell
- Watch as every keystroke gets slower and the memory use of
nu will soon be in the gigabytes
Expected behavior
At least be polynomial in parsing time
Screenshots
No response
Configuration
version | transpose key value | to md --pretty
| key |
value |
| version |
0.83.1 |
| branch |
|
| commit_hash |
|
| build_os |
macos-x86_64 |
| build_target |
x86_64-apple-darwin |
| rust_version |
rustc 1.71.1 (eb26296b5 2023-08-03) (built from a source tarball) |
| cargo_version |
cargo 1.71.1 |
| build_time |
1980-01-01 00:00:00 +00:00 |
| build_rust_channel |
release |
| allocator |
standard |
| features |
default, sqlite, trash, which, zip |
| installed_plugins |
hist, plot, xyplot |
Additional context
Found using the fuzzer. Original comment here #10376 (comment)
Describe the bug
When you type a sequence of open square braces, the parser branches exponentially and uses exponentially more memory for each extra branch.
How to reproduce
[[[[[[[[[[[[[[[[[[[[[[[[in nushellnuwill soon be in the gigabytesExpected behavior
At least be polynomial in parsing time
Screenshots
No response
Configuration
version | transpose key value | to md --pretty
Additional context
Found using the fuzzer. Original comment here #10376 (comment)