Quickly invoking PowerShell menu completion multiple times crashes Terminal #17220
Labels
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
In-PR
This issue has a related PR
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Needs-Tag-Fix
Doesn't match tag requirements
Product-Terminal
The new Windows Terminal.
Windows Terminal version
49e4eea
Windows build number
10.0.19045.4291
Other Software
No response
Steps to reproduce
"experimental.enableShellCompletionMenu": true
)l
Ctrl+Space
multiple times$result
. It doesn't have to be a valid shell completion data, but it should be a valid JSON. 7.6M characters is large enough to reproduce the bug on my computer and probably every other PC without trying to be fast.l
Ctrl+Space
multiple times. Depending on your CPU and the JSON size it may or may not have to be done quickly.Expected Behavior
Completion menu is shown or nothing happens
Actual Behavior
Terminal crashes or throws an exception or some kind of invalid memory access error, because
JSON::CharReader
inCommand::ParsePowerShellMenuComplete
isstatic
and shared between threads:terminal/src/cascadia/TerminalSettingsModel/Command.cpp
Line 693 in 49e4eea
Reproduction in one of the versions affected by #17204:
2024-05-08.22-04-15.mp4
Reproduction in other Terminal versions and demonstration of a possible fix (no menu is shown, because of the huge JSON, but the Terminal doesn't crash):
2024-05-08.23-51-43.mp4
The text was updated successfully, but these errors were encountered: