microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.07k stars 29.24k forks source link

Often getting full window hangs #71966

Closed eamodio closed 3 years ago

eamodio commented 5 years ago

Issue Type: Bug

I have been seeing hangs happen on and off since 1.33 was in insiders, but never pinpointed anything. And while I still haven't pinpointed anything the frequency has increased (even at the very end of 1.33). I have noticed that the hangs very often coincide with kicking off a task (usually it is a compound task).

How best can I help capture information to get to the bottom of it? When it happens the window is hung completely so I can't open devtools or anything like that.

VS Code version: Code - Insiders 1.34.0-insider (0ab39f4148f242e7b0802330385fc99b4845aa31, 2019-04-08T05:19:58.162Z) OS version: Windows_NT x64 10.0.18362

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 x 4008)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.93GB (18.83GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
aeschli commented 5 years ago

Can you check the Process Explorer? Also see https://github.com/Microsoft/vscode/wiki/Performance-Issues

eamodio commented 5 years ago

Unfortunately it hangs completely -- I can't do anything until it hangs for long enough and I get the Reopen, Continue Waiting dialog.

alexr00 commented 5 years ago

I haven't seen any hangs in 1.33 so I don't have any ideas about what might be causing it. If it's happening that often, can you keep the dev tools open and try to quickly grab a trace next time it freezes? I will try running compound tasks periodically to see if I can make it happen.

eamodio commented 5 years ago

@alexr00 I was able to get it to hang again with the devtools open

image

alexr00 commented 5 years ago

Thanks for getting the stack trace! @eamodio, any chance you remember what was happening when the hang occured?

@Tyriar looks like this is happening in the terminal.

eamodio commented 5 years ago

It usually seems to happen during the following workflow:

Here is my tasks.json

{
    "version": "2.0.0",
    "presentation": {
        "echo": false,
        "reveal": "always",
        "focus": false,
        "panel": "dedicated",
        "showReuseMessage": true
    },
    "tasks": [
        {
            "type": "npm",
            "script": "build",
            "group": "build",
            "problemMatcher": []
        },
        {
            "type": "npm",
            "script": "lint",
            "group": "build",
            "problemMatcher": []
        },
        {
            "type": "npm",
            "script": "watch",
            "group": "build",
            "isBackground": true,
            "problemMatcher": [],
            "presentation": {
                "group": "vscode"
            }
        },
        {
            "type": "npm",
            "script": "agent:watch",
            "group": "build",
            "isBackground": true,
            "problemMatcher": [],
            "presentation": {
                "group": "vscode"
            }
        },
        {
            "label": "watch",
            "dependsOn": ["npm: watch", "npm: agent:watch"],
            "group": "build",
            "isBackground": true,
            "problemMatcher": [],
            "presentation": {
                "group": "vscode"
            }
        }
    ]
}
lukeautry commented 5 years ago

This is happening for me with no special build workflow, just using the integrated terminal to run miscellaneous scripts. Somewhat of a showstopper for someone that uses the integrated terminal heavily.

Tyriar commented 5 years ago

I'm having trouble reproducing this via launching 2 tasks in a split terminal, any more details on a repro? 🤔

FYI the get console process list error in https://github.com/Microsoft/vscode/issues/71966#issuecomment-481863293 should be harmless.

eamodio commented 5 years ago

@Tyriar it often takes me a bunch of times trying it, but I can get it to reproduce pretty reliably. I'm using today's insiders (Commit: 0200bdd71e409954ae12149fe493f38065306555 Date: 2019-04-29T05:18:26.523Z) and my terminal shell is powershell core v6.2.0.

Here are my terminal settings if that helps any:

  "terminal.integrated.cursorStyle": "line",
  "terminal.integrated.drawBoldTextInBrightColors": false,
  "terminal.integrated.fontFamily": "Fira Code Retina",
  "terminal.integrated.fontSize": 13,
  "terminal.integrated.scrollback": 10000,
  "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
  "terminal.integrated.windowsEnableConpty": true,

I also noticed that it seems more reproducible when there is an existing terminal added to the mix:

I've reproduced it as quickly as 3 iterations of this loop, but sometimes it is more like 6-10 times.

EDIT: I've also reproduced this many times with and without all extensions disabled

Tyriar commented 5 years ago

Tried with those settings about 30-40 times and couldn't get it to happen.

Does running code-insiders --status in a extenral command prompt work when this is happening?

eamodio commented 5 years ago

It seems to work:

Version:          Code - Insiders 1.34.0-insider (473af338e1bd9ad4d9853933da1cd9d5d9e07dc9, 2019-05-01T00:22:05.899Z)
OS Version:       Windows_NT x64 10.0.18362
CPUs:             Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 x 4008)
Memory (System):  31.93GB (16.27GB free)
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                enabled
                  surface_synchronization:      enabled_on
                  video_decode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    0       88   36976  code-insiders main
    0       70   10876     shared-process
    0      208   24380     gpu-process
    0      459   25520     window (resultsFilesNode.ts - vscode-gitlens - Visual Studio Code - Insiders)
    0        5   14580       console-window-host (Windows internal process)
    0       14   29232       watcherService
    0        5   12012         console-window-host (Windows internal process)
    0       21   30700       searchService
    0        5   32212       console-window-host (Windows internal process)
    0       68   32284       "C:\Program Files\PowerShell\6\pwsh.exe"
    0        4    6048         C:\WINDOWS\system32\cmd.exe /c ""C:\Users\Eric\AppData\Local\nvs\default\npm.cmd" run pack"
    0       32    4536           "C:\Users\Eric\AppData\Local\nvs\default\\node.exe"   "C:\Users\Eric\AppData\Local\nvs\default\\node_modules\npm\bin\npm-cli.js" run pack
    0        7   37128             C:\WINDOWS\system32\cmd.exe /d /s /c vsce package
    0       57   35692               node   "C:\Users\Eric\code\vscode-gitlens\node_modules\.bin\\..\vsce\out\vsce" package
    0        6    1600                 C:\WINDOWS\system32\cmd.exe /d /s /c "npm -v"
    0        8    7216                   "C:\Users\Eric\AppData\Local\nvs\default\\node.exe"   "C:\Users\Eric\AppData\Local\nvs\default\\node_modules\npm\bin\npm-cli.js" -v
    0      491   36852       extensionHost
    0       65    9084         electron_node eslintServer.js
    0      184   24808         electron_node tsserver.js
    0       19   36260           electron_node typingsInstaller.js typesMap.js
    0       22   38088         "C:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe" "c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=36852
    0       39   38844       "C:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe" "c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\bootstrap-fork" ms-vscode.extensionHost "{\"common.vscodemachineid\":\"<id>\",\"common.vscodesessionid\":\"<id>\"}" AIF-<id>

Workspace Stats:
|  Window (resultsFilesNode.ts - vscode-gitlens - Visual Studio Code - Insiders)
|    Folder (vscode-gitlens): 599 files
|      File types: ts(211) svg(176) png(167) json(10) md(9) js(6) html(4)
|                  pdn(4) scss(2) mailmap(1)
|      Conf files: package.json(1) tsconfig.json(1) webpack.config.js(1)
|                  launch.json(1) settings.json(1) tasks.json(1)
Tyriar commented 5 years ago

Hmm...that told me less than I was hoping 🤔

eamodio commented 5 years ago

@Tyriar 😞 Is there anything else I can do to help? Not sure how to really debug this. I can screenshare or something if that helps too

eamodio commented 5 years ago

@Tyriar Since yesterday I've been seeing the same hangs, but now by just running my GitLens pack command in the terminal (npm run pack) without any of the split terminal stuff or anything special (no opening or closing terminals either). It seems to hang when my pack script calls out to vsce. Since yesterday, its happened about 6 times.

eamodio commented 5 years ago

Now I've seen it a few more times just running npm install from within the terminal.

Tyriar commented 5 years ago

I added logging to every call in the terminal that goes out to native code. After the next insiders build goes out (1.35.0-insiders), for those seeing the issues could you:

There should be "IPty#..." logs towards the bottom, the last few of those is what I'm interested in. If you can trigger a few times and check the log file to see if it's the same that would also be useful.

Tyriar commented 5 years ago

FYI if you're hitting this you can workaround is by disabling the conpty backend in settings:

"terminal.integrated.windowsEnableConpty": false
marcbelmont commented 5 years ago

Terminal hangs and gives me this. Other terminals and editors are working fine.

[uncaught exception]: TypeError: Cannot read property 'copyCellsFrom' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257 Uncaught TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:249
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:249
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'set' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'set' of undefined
    at InputHandler.print (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:269)
    at EscapeSequenceParser._printHandler (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:84)
    at EscapeSequenceParser.parse (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/EscapeSequenceParser.js:428)
    at InputHandler.parse (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:191)
    at Terminal._innerWrite (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:893)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:873
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:269 Uncaught TypeError: Cannot read property 'set' of undefined
    at InputHandler.print (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:269)
    at EscapeSequenceParser._printHandler (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:84)
    at EscapeSequenceParser.parse (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/EscapeSequenceParser.js:428)
    at InputHandler.parse (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/InputHandler.js:191)
    at Terminal._innerWrite (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:893)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:873
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at TextRenderLayer._forEachCell (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:51)
    at TextRenderLayer._drawBackground (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:101)
    at TextRenderLayer.onGridChanged (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:164)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/Renderer.js:167
    at Array.forEach ()
    at Renderer._renderRows (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/Renderer.js:167)
    at RenderDebouncer._innerRefresh (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/ui/RenderDebouncer.js:31)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/ui/RenderDebouncer.js:26
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:51 Uncaught TypeError: Cannot read property 'get' of undefined
    at TextRenderLayer._forEachCell (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:51)
    at TextRenderLayer._drawBackground (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:101)
    at TextRenderLayer.onGridChanged (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/TextRenderLayer.js:164)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/Renderer.js:167
    at Array.forEach ()
    at Renderer._renderRows (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/Renderer.js:167)
    at RenderDebouncer._innerRefresh (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/ui/RenderDebouncer.js:31)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/ui/RenderDebouncer.js:26
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'get' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110 Uncaught TypeError: Cannot read property 'get' of undefined
    at CursorRenderLayer._render (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:110)
    at CursorBlinkStateManager._renderCallback (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:74)
    at /usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/renderer/CursorRenderLayer.js:261
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'copyCellsFrom' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257 Uncaught TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property 'copyCellsFrom' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257 Uncaught TypeError: Cannot read property 'copyCellsFrom' of undefined
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
/usr/share/code/resources/app/out/bootstrap-window.js:5 [uncaught exception]: TypeError: Cannot read property '_data' of undefined
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/out/bootstrap-window.js:5 TypeError: Cannot read property '_data' of undefined
    at BufferLine.copyCellsFrom (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferLine.js:165)
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
onUnexpectedError @ /usr/share/code/resources/app/out/bootstrap-window.js:5
/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferLine.js:165 Uncaught TypeError: Cannot read property '_data' of undefined
    at BufferLine.copyCellsFrom (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferLine.js:165)
    at Buffer._reflowSmaller (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:257)
    at Buffer._reflow (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:177)
    at Buffer.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Buffer.js:152)
    at BufferSet.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/BufferSet.js:78)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/Terminal.js:1100)
    at Terminal.resize (/usr/share/code/resources/app/node_modules.asar/vscode-xterm/lib/public/Terminal.js:53)
    at e._resize (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3739)
    at (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/anonymous function).setTimeout (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:20:603)
Tyriar commented 5 years ago

@marcbelmont that's probably related to https://github.com/microsoft/vscode/issues/72149. This issue I'm pretty sure is a native crash, not a JS exception.

marcbelmont commented 5 years ago

@Tyriar How can I debug this?

usernamehw commented 5 years ago

Disabling conpty doesn't help.

``` Uncaught TypeError: Cannot read property 'closeMessage' of undefined at Object.leaveCallback [as hoverLeaveCallback] (workbench.main.js:2922) at MouseZone.leaveCallback (\resources\app\node_modules.asar\vscode-xterm\lib\Linkifier.js:194) at MouseZoneManager.clearAll (\resources\app\node_modules.asar\vscode-xterm\lib\ui\MouseZoneManager.js:59) at Terminal. (\resources\app\node_modules.asar\vscode-xterm\lib\Terminal.js:428) at Terminal.EventEmitter.emit (\resources\app\node_modules.asar\vscode-xterm\lib\common\EventEmitter.js:70) at Terminal.emit (\resources\app\node_modules.asar\vscode-xterm\lib\public\Terminal.js:47) at e._getDimension (workbench.main.js:3649) at e._evaluateColsAndRows (workbench.main.js:3648) at e.layout (workbench.main.js:3665) at u.layout (workbench.main.js:3506) at Object.layout (workbench.main.js:427) at viewItems.forEach.e (workbench.main.js:435) at Array.forEach () at p.layoutViews (workbench.main.js:435) at p.layout (workbench.main.js:430) at h.layout (workbench.main.js:3505) at g.layout (workbench.main.js:3509) at e._terminalService.terminalTabs.forEach.t (workbench.main.js:5431) at Array.forEach () at I.layout (workbench.main.js:5431) at e.layout (workbench.main.js:4893) at e.layout (workbench.main.js:5074) at C.layout (workbench.main.js:463) at p.orthogonalLayout (workbench.main.js:448) at g.layout (workbench.main.js:441) at Object.layout (workbench.main.js:427) at viewItems.forEach.e (workbench.main.js:435) at Array.forEach () at p.layoutViews (workbench.main.js:435) at p.layout (workbench.main.js:430) at g.orthogonalLayout (workbench.main.js:442) at g.layout (workbench.main.js:441) at m.layout (workbench.main.js:449) at S.layout (workbench.main.js:456) at W.layout (workbench.main.js:5093) at $.onWindowResize (workbench.main.js:5493) at _register.c.addDisposableListener.e (workbench.main.js:5493) ```

Although, maybe, it does. The terminal died but the window survived.

Tyriar commented 5 years ago

@usernamehw fixed that exception just now in https://github.com/microsoft/vscode/issues/72146

Tyriar commented 5 years ago

FYI I do expect disabling conpty to fix this, something is going wrong in one of the calls to the native side, I just need people who can reproduce the problem to follow the steps in https://github.com/microsoft/vscode/issues/71966#issuecomment-492766601 to find which native call(s) are causing the crash.

eamodio commented 5 years ago

@Tyriar I've tried to reproduce this LOTS of times in both insiders and stable, but I can't reproduce this at all anymore. My guess is that one of the recent Windows updates patched something that was causing the hang.

eamodio commented 5 years ago

@Tyriar while I can't repro this normally anymore, I am able to get it to happen, if I start a task that generates a LOT of output (e.g. running a full project lint with a CRLF / LF check the wrong way) and if I kill the task (using the trash can) while its still going, it seems to hang vscode every time.

And unfortunately I don't see any logging that really looks interesting -- I don't even see any IPty# calls that correspond to the task starting up. (Though I do see some from the terminal starting much earlier)

I do see this:

[2019-05-27 02:07:47.785] [renderer1] [error] (intermediate value) is not a function: TypeError: (intermediate value) is not a function
    at G.<anonymous> (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:5514:813)
    at Generator.next (<anonymous>)
    at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:34:621
    at new Promise (<anonymous>)
    at n (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:34:398)
    at lifecycleService.when.then (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:5514:699)
    at process._tickCallback (internal/process/next_tick.js:68:7)

But it seems to be in the logs regardless

eamodio commented 5 years ago

@Tyriar And they're back. Same scenario (no idea why they went away for a while there)

Here's the logs (or at least the end of it -- if you need the full log let me know)

[2019-06-03 23:32:17.103] [renderer1] [trace] terminalInstance#ctor (id: 6) {"name":"Task - npm: watch (vscode-codestream)","executable":"C:\\Program Files\\PowerShell\\6\\pwsh.exe","args":"-Command npm run watch","waitOnExit":"Terminal will be reused by tasks, press any key to close it.","initialText":"\u001b[1m> Executing task in folder vscode-codestream: npm run watch <\u001b[0m\n","cwd":{"$mid":1,"path":"/c:\\Users\\Eric\\code\\codestream\\vscode-codestream","scheme":"file"}}
[2019-06-03 23:32:17.106] [renderer1] [trace] terminalInstance#ctor (id: 7) {"name":"Task - npm: agent:watch (vscode-codestream)","executable":"C:\\Program Files\\PowerShell\\6\\pwsh.exe","args":"-Command npm run agent:watch","waitOnExit":"Terminal will be reused by tasks, press any key to close it.","initialText":"\u001b[1m> Executing task in folder vscode-codestream: npm run agent:watch <\u001b[0m\n","cwd":{"$mid":1,"path":"/c:\\Users\\Eric\\code\\codestream\\vscode-codestream","scheme":"file"}}
[2019-06-03 23:32:17.120] [renderer1] [trace] IPty#spawn C:\Program Files\PowerShell\6\pwsh.exe -Command npm run watch {"name":"pwsh.exe","cwd":"c:\\Users\\Eric\\code\\codestream\\vscode-codestream","env":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\Eric\\AppData\\Roaming","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","COMPUTERNAME":"RHINO","ComSpec":"C:\\WINDOWS\\system32\\cmd.exe","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\Eric","LOCALAPPDATA":"C:\\Users\\Eric\\AppData\\Local","LOGONSERVER":"\\\\RHINO","NUMBER_OF_PROCESSORS":"8","NVM_HOME":"C:\\ProgramData\\nvm","NVM_SYMLINK":"C:\\Program Files\\nodejs","OneDrive":"C:\\Users\\Eric\\OneDrive","OneDriveConsumer":"C:\\Users\\Eric\\OneDrive","OS":"Windows_NT","Path":"<removed>","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 94 Stepping 3, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"5e03","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files\\Intel\\","PUBLIC":"C:\\Users\\Public","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\WINDOWS","TEMP":"C:\\Users\\Eric\\AppData\\Local\\Temp","TMP":"C:\\Users\\Eric\\AppData\\Local\\Temp","USERDOMAIN":"RHINO","USERDOMAIN_ROAMINGPROFILE":"RHINO","USERNAME":"Eric","USERPROFILE":"C:\\Users\\Eric","VS140COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\","windir":"C:\\WINDOWS","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.35.0-insider","LANG":"en_US.UTF-8"},"cols":121,"rows":24,"experimentalUseConpty":true,"conptyInheritCursor":true}
[2019-06-03 23:32:17.124] [renderer1] [trace] IPty#spawn C:\Program Files\PowerShell\6\pwsh.exe -Command npm run agent:watch {"name":"pwsh.exe","cwd":"c:\\Users\\Eric\\code\\codestream\\vscode-codestream","env":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\Eric\\AppData\\Roaming","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","COMPUTERNAME":"RHINO","ComSpec":"C:\\WINDOWS\\system32\\cmd.exe","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\Eric","LOCALAPPDATA":"C:\\Users\\Eric\\AppData\\Local","LOGONSERVER":"\\\\RHINO","NUMBER_OF_PROCESSORS":"8","NVM_HOME":"C:\\ProgramData\\nvm","NVM_SYMLINK":"C:\\Program Files\\nodejs","OneDrive":"C:\\Users\\Eric\\OneDrive","OneDriveConsumer":"C:\\Users\\Eric\\OneDrive","OS":"Windows_NT","Path":"<removed>","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 94 Stepping 3, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"5e03","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files\\Intel\\","PUBLIC":"C:\\Users\\Public","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\WINDOWS","TEMP":"C:\\Users\\Eric\\AppData\\Local\\Temp","TMP":"C:\\Users\\Eric\\AppData\\Local\\Temp","USERDOMAIN":"RHINO","USERDOMAIN_ROAMINGPROFILE":"RHINO","USERNAME":"Eric","USERPROFILE":"C:\\Users\\Eric","VS140COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\","windir":"C:\\WINDOWS","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.35.0-insider","LANG":"en_US.UTF-8"},"cols":121,"rows":24,"experimentalUseConpty":true,"conptyInheritCursor":true}
[2019-06-03 23:32:17.625] [renderer1] [debug] Terminal process ready (shellProcessId: 27956)
[2019-06-03 23:32:17.625] [renderer1] [trace] IPty#write 6 characters
[2019-06-03 23:32:17.625] [renderer1] [trace] IPty#resize 121 24
[2019-06-03 23:32:17.628] [renderer1] [debug] Terminal process ready (shellProcessId: 13292)
[2019-06-03 23:32:17.629] [renderer1] [trace] IPty#write 6 characters
[2019-06-03 23:32:17.629] [renderer1] [trace] IPty#resize 121 24
[2019-06-03 23:32:19.930] [renderer1] [trace] terminalInstance#dispose (id: 7)
[2019-06-03 23:32:19.934] [renderer1] [trace] IPty#kill
[2019-06-03 23:32:20.045] [renderer1] [debug] Terminal process exit (id: 7) with code undefined
[2019-06-03 23:32:20.045] [renderer1] [debug] Terminal process exit (id: 7) state 4
[2019-06-03 23:32:20.045] [renderer1] [trace] terminalInstance#dispose (id: 7)
[2019-06-03 23:32:20.046] [renderer1] [trace] telemetry/taskService {"trigger":"command","runner":"terminal","taskKind":"workspace>extension","command":"other","success":true,"exitCode":0}
[2019-06-03 23:32:20.046] [renderer1] [trace] telemetry/workbenchActionExecuted {"id":"workbench.action.terminal.kill","from":"panel"}
[2019-06-03 23:32:20.062] [renderer1] [trace] IPty#resize 245 24
[2019-06-03 23:32:20.837] [renderer1] [trace] terminalInstance#dispose (id: 6)
[2019-06-03 23:32:20.842] [renderer1] [trace] IPty#kill
[2019-06-03 23:32:20.960] [renderer1] [debug] Terminal process exit (id: 6) with code undefined
[2019-06-03 23:32:20.960] [renderer1] [debug] Terminal process exit (id: 6) state 4
[2019-06-03 23:32:20.960] [renderer1] [trace] terminalInstance#dispose (id: 6)
[2019-06-03 23:32:20.961] [renderer1] [trace] telemetry/taskService {"trigger":"command","runner":"terminal","taskKind":"workspace>extension","command":"other","success":true,"exitCode":0}
[2019-06-03 23:32:20.961] [renderer1] [trace] telemetry/workbenchActionExecuted {"id":"workbench.action.terminal.kill","from":"panel"}
[2019-06-03 23:32:21.023] [renderer1] [trace] IPty#resize 245 24

Here you can see I started 2 terminal tasks, and killed them. It looks like the hanging line is trying to resize the terminal after its been killed

Tyriar commented 5 years ago

Thanks @eamodio, I think that specifically is related to the introduction of the asynchronous spawning of the process introduced in https://github.com/microsoft/vscode/pull/72784

Specifically this line is the issue as it doesn't set _isDisposed:

https://github.com/microsoft/vscode/blob/799c499449ad92c66001c504c779a660ba4b4ee8/src/vs/workbench/contrib/terminal/node/terminalProcess.ts#L145

That change was added in May but there was another crash I just fixed for winpty (https://github.com/microsoft/vscode/issues/74181) that could have just as easily happened in conpty, so maybe that was the one you were seeing in April?

Tyriar commented 5 years ago

We get a EBADF from ioctl on macOS which bricks the terminal when this happens: https://github.com/microsoft/vscode-remote-release/issues/518, trying to resize a not yet existing terminal I think? Also related to the async change.

jfcervera commented 5 years ago

@Tyriar now that the Remote Development is available in the stable VSCode, I have tried there and the terminal works fine there, so the issue seems to be in a difference between stable and insider, probably the bit you are referring to.

Thanks

Tyriar commented 5 years ago

@jfcervera if the window is using remote development this crash would not happen as the terminal process is on the remote side.

jfcervera commented 5 years ago

@Tyriar for clarity, I was talking about https://github.com/microsoft/vscode-remote-release/issues/518, which you closed as duplicated of this one. In my case I never had a crash, I just got stuck on "Starting ...", this is not happening now that this has been made available in the stable version but is still the case in the insider version. Thought that knowing this may be helpful.

Tyriar commented 5 years ago

I'm not sure this is still happening after the fixes to ensure invalid dimensions aren't used for resizing, does anyone still see this in Insiders?

ghost commented 5 years ago

@Tyriar I don't know, if its related, but freezes are still happening for me with latest portable insiders build (vanilla). The freeze always happens when I close an open integrated terminal (via the trash symbol). And it was just one terminal open / no split panels.

I cannot consistently reproduce it. My highly professional test case (😎): Typing 'asdf' (arbitrary input), press enter, repeat this 30 times or better more so that there is effectively just a bunch of terminal output produced. After that, shutting this terminal down freezes my VS code window completely, which results in windows asking me to reopen or close it. Sometimes I had to reopen terminal and repeat to see it hang.

Tried also with developer tools and process explorer open, no error log and nothing consuming much CPU, it just gets unresponsive.

My environment: Windows 10 Powershell as default terminal, but also happened with cmder in my other environment VSCode-win32-x64-1.36.0-insider

allusernamestakenexceptthis commented 5 years ago

the issue I opened "VSCode doesn't save changes to file after running a process in terminal #76356" is closed and marked duplicate of this, but I'm not using insider build. just regular one I downloaded from microsoft site. 1.35 and it happens in certain reproducible way. it happens every time following the steps. here https://github.com/microsoft/vscode/issues/76356

Tyriar commented 5 years ago

@allusernamestakenexceptthis this issue is not restricted to insiders only

hphpwj commented 5 years ago

Occasional Windows 7 is hung up when I use VS Code integrated-terminal, When I logout Windows 7 SP1, then the dialog displayed: TIM图片20190715210131 Windows 7 is OK after I close this dialog. The versions are 1.3X stable I used.

eamodio commented 5 years ago

@Tyriar this issue had seemingly been resolved for me, after you made a few fixes, but since 1.38-insiders, it seems to have come back again.

Tyriar commented 5 years ago

😕 there was a workaround for https://github.com/microsoft/terminal/issues/1810 added, do you use tasks as it could still possibly happen for tasks?

eamodio commented 5 years ago

It definitely happens a LOT more frequently with tasks, but a couple of times I've had it happen when typing in the terminal

Tyriar commented 5 years ago

@eamodio it happened just when typing in the terminal? I think the hang we identified happened because conpty has a race condition when you close the terminal too fast and we used a special flag that only tasks uses now.

eamodio commented 5 years ago

Yeah, it crashed once for sure (and I'm pretty sure there was another time) where I was just starting to type a command (though I might have killed a terminal just before it). But in all the other cases now, it happens when a task starts -- usually my prettier/lint task (using yarn as the launcher)

Tyriar commented 5 years ago

FYI @alexr00 (in case you unsubscribed)

eamodio commented 5 years ago

I just had it happen again, this time I just killed a terminal that was started from my watch task, which brought me back to my last opened terminal and I started typing my next command and I got about 15 characters in before vscode hung completely.

Happened again -- exactly the same scenario

Tyriar commented 5 years ago

Looks like we need https://github.com/microsoft/terminal/issues/1810 to be fixed in Windows, I'm hoping the fix can get pulled into 1903 https://github.com/microsoft/terminal/issues/1810

Tyriar commented 5 years ago

@eamodio if you get it to happen without using tasks can you create a process dump file? https://github.com/microsoft/terminal/issues/1810#issuecomment-524003199 You should be able to do this via task manager:

Screen Shot 2019-08-22 at 11 10 23 AM

You'll need to do this on the hanging conhost process which should be under VS Code. There may be multiple of these, you'll know the right one if when you kill it the UI becomes responsive again.

eamodio commented 4 years ago

This seemingly went away (was fixed), but sometime since 1.41 or the last couple (few?) Windows insiders builds -- this is back.

eamodio commented 4 years ago

So it looks like what was fixed, was reverted: https://github.com/microsoft/terminal/issues/1810#issuecomment-551985906

And that timeline somewhat lines up with my experience.

noam-honig commented 4 years ago

I just wanted to emphasize how critical this issue is - any time I terminate a process in VSCode - it hangs and I have to wait for VSCode to restart. as reported in issue

85937

JoeyFenny commented 4 years ago

I see there are dozens of other tickets referencing this same issue. I haven't read through all of them so I'm not sure what the status of this bug is, but since this ticket is still open (after a year) and since I'm still experiencing said issues constantly, with the most recent occurrence happening approximately 4 minutes ago, I'm assuming it hasn't been resolved yet. This happens to me all the time. It happens on my Windows desktop. It happens on my Windows laptop. I've never once had it happen on my Macbook. I can recreate this issue 95% of the time by having multiple terminal instances open, and then clicking on the "kill terminal" (garbage icon) on > 1 of them in rapid succession. Please let me know where to find the logs I need to provide you with in order to help you fix this.

This issue is more aligned with what I've been experiencing but said ticket was closed with a reference to this one.

noam-honig commented 4 years ago

I also run into this issue frequently. The fix I use is to change the settings as follows: image

Disabling Conpty