Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal makes VS code unresponsive #40502

Closed
ytimenkov opened this issue Dec 19, 2017 · 26 comments
Closed

Terminal makes VS code unresponsive #40502

ytimenkov opened this issue Dec 19, 2017 · 26 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) perf terminal Integrated terminal issues under-discussion Issue is under discussion for relevance, priority, approach windows VS Code on Windows issues

Comments

@ytimenkov
Copy link

  • VSCode Version: Code 1.19.0 (816be67, 2017-12-14T12:06:43.492Z)
  • OS Version: Windows_NT x64 6.1.7601
  • Extensions:
Extension Author (truncated) Version
Bookmarks ale 0.18.0
head-file-guard bjr 0.0.2
xml Dot 1.9.2
gitlens eam 6.4.0
python ms- 0.9.0
cpptools ms- 0.14.5-insiders
PowerShell ms- 1.5.1
vscode-icons rob 7.19.0
cmake twx 0.0.17

After some upgrade (1.17 or so, probably related with terminal refactoring) I've noticed that terminal sometimes just hangs.
(If it matters, I run VirtualBox linux VM and run heavy compilation inside, piping compiler output via SSH).

Now I've ran Process Monitor and it showed that 1 CPU core was utilized by "System" process and code --type=gpu-process took 7-9% while nothing was really rendered in terminal (I ran top this time).

When I tried new "status" command it didn't work as advertised:

>code --status
[main 9:55:18 AM] SyntaxError: Unexpected token  in JSON at position 4697
    at JSON.parse (<anonymous>)
    at ChildProcess.<anonymous> (C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:132:425)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Maybe there is some interference with other programs I have to have installed ("antivirus"), but still VS Code behavior is odd.

The problem comes time to time (especially under heavy load), so please tell how I can gather more information.

@vscodebot vscodebot bot added the terminal Integrated terminal issues label Dec 19, 2017
@frank-dspeed
Copy link

@ytimenkov https://code.visualstudio.com/docs/extensions/debugging-extensions visit that site watch under profiling that will give you all needed insights in the chrome dev console

@ytimenkov
Copy link
Author

@frank-dspeed I will try. However last time I tried to investigate issue with VS code engine itself (#31481) integrated profiler didn't help.

@ytimenkov
Copy link
Author

Happened again. When VS code hangs it doesn't respond at all, so there is no way to open profiler. After few mouse clicks I got a message box asking whether I want to restart VS code because it is unresponsive.

Got this call stack from Process Explorer (from thread which consumed 10% CPU):

ntoskrnl.exe!memset+0x61a
ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
ntoskrnl.exe!KeWaitForSingleObject+0x19f
ntoskrnl.exe!PoStartNextPowerIrp+0xbd0
ntoskrnl.exe!PoStartNextPowerIrp+0x186d
ntoskrnl.exe!KiCheckForKernelApcDelivery+0x25
ntoskrnl.exe!ExReleaseRundownProtectionCacheAwareEx+0x1c41
ntoskrnl.exe!KeSynchronizeExecution+0x28be
VCRUNTIME140.dll!memmove+0x57
libglesv2.dll!gl::TexParameterIuivRobustANGLE+0xa0ab0
libglesv2.dll!gl::TexParameterIuivRobustANGLE+0xa64ac
libglesv2.dll!gl::TexParameterIuivRobustANGLE+0xb2aa3
libglesv2.dll!gl::TexParameterIuivRobustANGLE+0xb2231
libglesv2.dll!glWaitSync+0x361e
libglesv2.dll!glWaitSync+0xee8d
libglesv2.dll!gl::TexImage2D+0xd2
Code.exe!IsSandboxedProcess+0x95c4a9
Code.exe!IsSandboxedProcess+0xc29552
Code.exe!IsSandboxedProcess+0xc2dbc8
Code.exe!IsSandboxedProcess+0xc5fd76
Code.exe!IsSandboxedProcess+0xc334d9
Code.exe!IsSandboxedProcess+0xc402df
Code.exe!IsSandboxedProcess+0xd86301
Code.exe!IsSandboxedProcess+0xc6e671
Code.exe!IsSandboxedProcess+0xbd220e
Code.exe!IsSandboxedProcess+0xbce9a6
Code.exe!IsSandboxedProcess+0xbd2b55
Code.exe!IsSandboxedProcess+0x563acf
Code.exe!IsSandboxedProcess+0xb1160e
Code.exe!IsSandboxedProcess+0xb11593
Code.exe!IsSandboxedProcess+0xb0f0c6
Code.exe!GetHandleVerifier+0xa46fd
Code.exe!GetHandleVerifier+0x45916
Code.exe!GetHandleVerifier+0x44400
Code.exe!GetHandleVerifier+0xa6633
Code.exe!GetHandleVerifier+0x4196e
Code.exe!IsSandboxedProcess+0x394f26
Code.exe!GetHandleVerifier+0x350ed9
Code.exe!GetHandleVerifier+0x350dd0
Code.exe!GetHandleVerifier+0xf96ac
Code.exe+0xf7e8f
Code.exe!IsSandboxedProcess+0x2c78cfb
kernel32.dll!BaseThreadInitThunk+0xd
ntdll.dll!RtlUserThreadStart+0x21

@frank-dspeed
Copy link

@Tyriar Any suggestions else i would say this is not so easy debug able as it can be related also to external software. we would need to reproduce that on other installations so we need to collect user data maybe some how?

  • Creating Crash dumps ?

@ytimenkov
Copy link
Author

One thing comes to my mind: I run tmux via ssh and could be related to how it renders (I.e. many ascii- sequences for colours or cursor movement). Mintty was quite sluggish as well when I attached to the session.

@Tyriar
Copy link
Member

Tyriar commented Dec 20, 2017

Are people having this issue all on VMs? VMs are known to have issues with GPU rendering and the terminal is now rendered that way. I suggest trying to close all VS Code windows and then relaunching using code --disable-gpu

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Dec 20, 2017
@ytimenkov
Copy link
Author

Code itself runs on the host, terminal runs ssh.

@Tyriar
Copy link
Member

Tyriar commented Dec 21, 2017

@ytimenkov did you try relaunching code using code --disable-gpu?

@ytimenkov
Copy link
Author

I thought it is required for vm...
Will try tomorrow.

Stupid question: if --disable-gpu works, what it tells us?
I also haven't figured out how to reproduce it. It happens sometimes, so hard to tell for sure if it's gone.

@Tyriar
Copy link
Member

Tyriar commented Dec 21, 2017

@ytimenkov if --disable-gpu fixes the issue that means it's related to GPU rendering in VMs which basically lumps this issue in with a bunch of upstream/Chromium related bugs.

@frank-dspeed
Copy link

@Tyriar i think that needs to get documented in the readme under something like known issues as such gpu issues will happen to tons of people but they don't report that as they are not as qualifyed as @ytimenkov to report the exact problem

@Tyriar
Copy link
Member

Tyriar commented Dec 29, 2017

Another repro in #40886

@Tyriar Tyriar added perf windows VS Code on Windows issues under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Dec 29, 2017
@dantho
Copy link

dantho commented Jan 3, 2018

Same problem here. Mine is HIGHLY reproduce-able. I just hold down the enter key in the terminal until it scrolls and then crashes -- every time. (~50 carriage returns)
Output from:
(See "[main 2:26:55 PM] [VS Code]: render process crashed!")
code --verbose --disable-gpu

[main 2:24:06 PM] Starting VS Code
[main 2:24:06 PM] from: c:\Program Files\Microsoft VS Code\resources\app
[main 2:24:06 PM] args: { _: [],
help: false,
h: false,
version: false,
v: false,
wait: false,
w: false,
diff: false,
d: false,
add: false,
a: false,
goto: false,
g: false,
'new-window': false,
n: false,
'unity-launch': false,
'reuse-window': false,
r: false,
performance: false,
p: false,
'prof-startup': false,
verbose: true,
logExtensionHostCommunication: false,
'disable-extensions': false,
disableExtensions: false,
'list-extensions': false,
'show-versions': false,
nolazy: false,
'skip-getting-started': false,
'sticky-quickopen': false,
'disable-telemetry': false,
'disable-updates': false,
'disable-crash-reporter': false,
'skip-add-to-recently-opened': false,
status: false,
s: false,
'disable-gpu': true }
[main 2:24:06 PM] Resolving machine identifier...
[main 2:24:06 PM] Resolved machine identifier: 401ccb95b9411535e65db1f966b6afa9e8284de6e8a69bb0b28ed1b060ca028c
[23560:0103/142411.360:INFO:CONSOLE(1224)] "%cTRACE", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1224)
[main 2:24:20 PM] IPC#vscode-workbenchLoaded
[23560:0103/142420.742:INFO:CONSOLE(2571)] "%c[Extension Host] %cdebugger listening on port 9333", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (2571)
[23560:0103/142424.998:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)
[23560:0103/142424.998:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)
[23560:0103/142424.998:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)
[23560:0103/142425.965:INFO:CONSOLE(2569)] "%c[Extension Host] %cdebugger inspector at %cDebugger listening on port 9333.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9333/f4cf926f-66d4-44cc-8d0b-8db954ada2cb
", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (2569)
[23560:0103/142427.868:INFO:CONSOLE(1224)] "%cTRACE", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1224)
[main 2:26:55 PM] [VS Code]: render process crashed!
[23560:0103/142701.799:INFO:CONSOLE(1224)] "%cTRACE", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1224)
[main 2:27:09 PM] IPC#vscode-workbenchLoaded
[23560:0103/142710.750:INFO:CONSOLE(2571)] "%c[Extension Host] %cCould not find a free port for debugging", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (2571)
[23560:0103/142715.142:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)
[23560:0103/142715.142:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)
[23560:0103/142715.142:INFO:CONSOLE(1316)] "Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1316)[main 2:28:04 PM] [VS Code]: detected unresponsive

@dantho
Copy link

dantho commented Jan 3, 2018

code --status

Version: Code 1.19.1 (0759f77, 2017-12-19T09:46:23.884Z)
OS Version: Windows_NT x64 10.0.16299)
CPUs: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz (4 x 2494)
Memory (System): 7.91GB (1.48GB free)
VM: 0%
Screen Reader: no
CPU % Mem MB Process
0 88 code main
0 183 window (Untitled-1 - Visual Studio Code)
0 17 "C:\Program Files\Microsoft VS Code\Code.exe" --reporter-url=https://rink.hockeyapp.net/api/2/apps/0ac07349c6e34e978fdfb42074932f22/crashes/upload --application-name=VSCode "--crashes-directory=C:\Users\DThornto\AppData\Local\Temp\VSCode Crashes" --v=1
0 64 extensionHost
0 35 terminal
0 11 "c:\Program Files\Microsoft VS Code\resources\app\node_modules\node-pty\build\Release\winpty-agent.exe" \.\pipe\winpty-control-31588-1-1d384c9c386db56-ed832ae8fbe819c22444e2a0a5a6474a 0 1 132 33
0 69 C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
0 14 C:\WINDOWS\system32\conhost.exe 0x4
0 70 shared-process

@dantho
Copy link

dantho commented Jan 3, 2018

Coincident with the crash, I noticed this separate process spike up to ~30%:
BeyondTrust PowerBroker for Windows Service

This is a corporate machine and this process is a piece of the Digital Agent (aka Big Brother) stuff my IT folks run in the background. Is that process just observing the crash? Or causing it?

@frank-dspeed
Copy link

@DanT-Git this is probally observing it. I come to that result because of Windows Internal API's but it would be nice to know what it does or logs. You should Consult your IT and Post back here the Result. As we can't Reproduce that issue as HIGLY as you :) without the Software it could be all Kind of stuff.

The Key Problem here is the Userland a Operating system layer that is shared.

I Think the most logical thing for this issue to let it end is that we need to Create a ISSUE for vscode Unikernel Support so we Eliminate The Userland and let vscode be the user land.

So we should Create a Issue to get vscode Running to make it simple on NodeOS if we can reproduce such hanging there we are save that it is a vscode and not a userland issue.

@Tyriar
Copy link
Member

Tyriar commented Jan 4, 2018

@frank-dspeed I'm a bit confused by your comment, what is unikernel, userland and nodeos?

@frank-dspeed
Copy link

@Tyriar A Operating system is based on layers the userland is the layer that holds stuff to execute Applications i Would Suggest to simply google all 3 words and get familar with that its worth! As this is what will be the future of security and deployment.

It will solve many problems Example for a UserLand is for example all After Init and the Init Process it self. Its Called userland because the user can at this state send commands to the cpu and hardware. The Normal Operating systems like Linux are Userlands sitting on top of a Kernel. This abstractions make things Complicated as they Share Stuff.

Simply belive me its worth googling this terms maybe you know docker or moby? This are at present Unikernel like Concepts. A Unikernel is a Compiled Kernel that runs a Application on a Single Machine and only got drivers and bindings for this one Application without the Concepts of Users or shells. So your Application is the Only thing running as Operating System Directly.

@frank-dspeed
Copy link

frank-dspeed commented Jan 5, 2018

Image of UniKernel

Mirage is a Unikernel but as we are using NodeJS we have NodeOS https://github.com/NodeOS/NodeOS

  • a Complet Operating System build in NodeJS running exactly only NodeJS :)

@frank-dspeed
Copy link

@Tyriar as your at microsoft maybe you can get this running

@thernstig
Copy link
Contributor

@Tyriar I'm having this problem as well. VS Code basically freezes (no crash) when I maximize my terminal. I'd be happy to supply logs if I just get some rundown on exactly what you need. Reading this thread I get no clear picture what you would expect.

@Tyriar
Copy link
Member

Tyriar commented Mar 4, 2018

@thernstig you're probably seeing this #42999

@thernstig
Copy link
Contributor

thernstig commented Mar 5, 2018

@Tyriar Thanks for the reference, but I cannot see how that issue is related.

When I increase the size of the integrated terminal (dragging the delimiter upwards or maximize) it gets to a certain point where memory and gpu runs amok. It still responds, albeit very slow (seconds). So I do not even need to maximize the integrated terminal.

It's happens every time as soon as it is increased about more than half the Y-axis of my screen.

Note that this also only started happening for me in the integrated terminal refactoring which I believe was 1.17.

@Tyriar
Copy link
Member

Tyriar commented Mar 6, 2018

@thernstig ah, sounds like #36913 / #44416 then.

@thernstig
Copy link
Contributor

@Tyriar Thanks, it is most likely #36913 - hope a fix gets released soon then :)

@sutt
Copy link

sutt commented Apr 12, 2018

I'm getting very sluggish behavior in integrated terminal: ~2 secs / letter typed. Also, it gets to the point I can't switch back to an editorGroup, I'm hung on focus to terminal.

I'm able to reproduce this by changing the value for "terminal.integrated.shell.windows" in user-settings. Specifically by commenting out one pointing to cmd, and uncommenting another line pointing to git bash:
"terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe"
// "terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
->
// "terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe"
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"

Now create a new terminal of the new type. Run a command. Still should run smooth.
Now switch terminal to previous (of the old type). The sluggishness appears.
Also, when you switch terminal to previous again (the new type), the sluggishness happens too. So now no terminal types run smoothly.

A restart seems to fix it. But it would be nice to deploy multiple terminal types in one session.

For reference:
VSCode
Version 1.22.1
Commit 950b8b0
Date 2018-04-06T00:27:19.487Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture ia32

Windows latest:
April 10, 2018—KB4093112 (OS Build 16299.371)

Recently added a .code-workspace with commented out "terminal.integrated.shell.windows" setting.

@Tyriar Tyriar closed this as completed Apr 30, 2018
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 30, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) perf terminal Integrated terminal issues under-discussion Issue is under discussion for relevance, priority, approach windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

6 participants