Repository: vscode
Issue: Random crashes when quickly printing many millions of lines in terminal
Labels: bug,terminal-rendering

[ee068bfc-f4ec-49fa-9b22-fe37962b729b.dmp](https://github.com/microsoft/vscode/files/14771662/ee068bfc-f4ec-49fa-9b22-fe37962b729b.dmp)
Type: <b>Bug</b>

Little C program to print 200 million lines did it first try on Insiders:

```
#include <stdio.h>
int main() {
    int i;
    for (i = 0; i < 200000000; i++) {
        printf("%d Hello, World!\n", i);
    }
    return 0;
}
```

```
gcc main.c
./a.out
```

My current project prints out tens of millions of lines and was crashing VScode maybe one run out of half a dozen. I thought it was memory related so wrote a test program with no memory handling. 20 millions lines wasn't enough to reproduce it but 200 million crashed VScode so I tried Nightly and the same.

There is no error or warning of any kind. VScode just suddenly vanishes.

I've just reproduced it with `--crash-reporter-directory` and attached the resulting `.dmp`

VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:57.520Z)
OS version: Darwin arm64 23.4.0
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 (8 x 24)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|5, 5, 4|
|Memory (System)|16.00GB (0.06GB free)|
|Process Argv|--crash-reporter-id b5083731-0c96-4905-a65b-dc3f3c61823b|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (32)</summary>

Extension|Author (truncated)|Version
---|---|---
quitcontrol-vscode|art|4.0.0
codeium|Cod|1.8.17
doxdocgen|csc|1.4.0
arm|dan|1.7.4
dart-code|Dar|3.84.0
vscode-eslint|dba|2.4.4
kotlin|fwc|0.2.34
go|gol|0.41.2
vscode-ansi|ili|1.1.7
better-cpp-syntax|jef|1.17.2
better-objc-syntax|jef|0.2.0
svg|joc|1.5.3
vscode-peacock|joh|4.2.2
vscode-http-client|mkl|0.34.0
csharp|ms-|2.22.5
vscode-dotnet-runtime|ms-|2.0.3
debugpy|ms-|2024.2.0
python|ms-|2024.2.1
vscode-pylance|ms-|2024.3.2
cpptools|ms-|1.20.0
cpptools-extension-pack|ms-|1.3.0
vscode-typescript-next|ms-|5.5.20240326
vsliveshare|ms-|1.0.5918
rust-analyzer|rus|0.3.1896
swift-lang|ssw|1.8.1
vscode-lldb|vad|1.10.0
intellicode-api-usage-examples|Vis|0.2.8
vscodeintellicode|Vis|1.3.1
vscode-gradle|vsc|3.13.5
debug|web|0.27.0
cursorCharCode|zei|0.2.4
vscode-zig|zig|0.5.4

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
vscrpc:30673769
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp1r6:30993540
dsvsc020:30976470
pythonait:30996668
gee8j676:30988843
dsvsc021:30996838
gd77d436:30999572

```

</details>

<!-- generated by issue reporter -->