Memory leak
Windows Terminal version
1.22.12111.0
Windows build number
10.0.26100.4946
Other Software
No response
Steps to reproduce
Enter curl https://s1.cubzyn.net/other/curl.me.php (which curls a large amount of binary to the terminal) And now even if the user closes the terminal window even after the command finished the console window and PTY process uses many gigabytes of RAM and continues to use more until it crashes. I have attached the source code of the PHP script.
Expected Behavior
Since binary is being sent to terminal some issues are expected such as bells, messed up terminal or messed up input. However not a large memory leak.
Actual Behavior
Terminal freezes when command finishes due to the memory leak and leaks gigabytes of memory in the PTY host process until it crashes.
So, there are a couple places where we cache in-progress VT sequences (SOS, APC, PM, DCS, and OSC); if you spam a bunch of random data you will eventually generate a control sequence introducer and cause us to start buffering...
But also,
... why?
I have tried this locally with and without the use of curl and could not observe a memory leak myself. Unassigning this issue until someone can reproduce and investigate this.
Hi. I just retried this and did not experience the memory leak so I think it may have been patched by a different change.
Hi. After doing some more testing this is still and issue and you can reproduce it if you run the command a few more times as the PHP script randomizes the output. I had the issue happen to me after about 5 trys. Try it a few more times as it is random. When it happened this time it froze my PC and i had to reboot.
I've tried it lots and lots of times now and couldn't get it to reproduce.
I will test it on a new fresh installed VM to see if it occurs. I will attach a video if it.
Actualy im having some issues getting the VM to work however the issue still occurs for me. I am on windows [Version 10.0.26100.6899] terminal: 1.23.12811.0
Hi. After doing some more testing this is still and issue and you can reproduce it if you run the command a few more times as the PHP script randomizes the output. I had the issue happen to me after about 5 trys. Try it a few more times as it is random. When it happened this time it froze my PC and i had to reboot.
I think for reproducible example you can pregenerate 10 files and curl these pregenerated files each. Find that one who do memory leak and update this issue with that uploaded STATIC file instead of .php file, so everyone can reproduce that case.