Repository navigation
Closed
Labels
freeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinfo-neededIssue requires more information from postermacosIssues with VS Code on MAC/OS XtelemetryTelemetry system issues
Milestone
Description
Type: Bug
VS Code has trouble quitting with the cmd+Q shortcut on macOS. When I use cmd+Q quickly after cmd+shift+W, VS Code hangs and remains open. I can tell that VS Code is open by the indicator dot under its icon in the dock.
Steps to reproduce:
- Open VS Code on macOS
- Use
cmd+shift+Wto close all windows - Quickly use
cmd+Qto quit VS Code - Notice that the "Code" title in the macOS menubar flashes
- Notice the dot under VS Code's icon in the dock and that VS Code remains open
I've seen this bug in both VS Code stable and insiders.
Here's a screen recording of this bug:
vscode-no-quit.mp4
Notice how the "Code" title in the menubar flashes as the windows close. It seems like VS Code is receivng the quit event, but it's getting stuck somewhere.
VS Code version: Code 1.74.3 (97dec17, 2023-01-09T17:05:47.808Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: No
System Info
| Item | Value |
|---|---|
| CPUs | Apple M1 Max (10 x 24) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
| Load (avg) | 2, 2, 2 |
| Memory (System) | 64.00GB (36.59GB free) |
| Process Argv | --crash-reporter-id 3488aeac-bc57-46d3-ac1a-73d78d4582d6 |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848:30577860
nodejswelcome1:30587005
2e4cg342:30602488
pyind779:30647091
89544117:30613380
2i9eh265:30646982
Reacted by Ryan Caldwell, Vincent Dondain, Christian Klaussner and Hao1015
Metadata
Metadata
Labels
freeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinfo-neededIssue requires more information from postermacosIssues with VS Code on MAC/OS XtelemetryTelemetry system issues
Activity
jungaretti commentedon Jan 31, 2023
#172846 may be related to this bug.
VincentDondain commentedon Jan 31, 2023
Something similar happens to me when I update my VSCode insider, the editor restart after the update and I do not have the close buttons anymore in the UI, nor can I quit the program with cmd + Q, I need to force quit it.
bpasero commentedon Feb 1, 2023
Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/
jungaretti commentedon Feb 1, 2023
Here's a repro with insider:
insiders-quit.mp4
Version: 1.75.0-insider (Universal)
Commit: 0615c4f
Date: 2023-01-31T00:09:14.434Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
bpasero commentedon Feb 1, 2023
Can you try to run
code --disable-extensions --user-data-dir <directory>where<directory>is an empty folder? This will ensure Code is starting with a fresh data directory, e.g. no specific settings and without any extensions running.jungaretti commentedon Feb 1, 2023
I see the same behavior with
code-insiders --disable-extensions --user-data-dir <directory>insiders-vanilla.mp4
bpasero commentedon Feb 1, 2023
Please see if you can find any logged output that could help us find the source of the issue:
code --verbosefrom the command line and attach the outputThanks!
jungaretti commentedon Feb 1, 2023
Here's the complete output of
code-insiders --disable-extensions --user-data-dir /var/folders/2g/cjbxg4p94_925xh94s396hth0000gn/T/tmp.kxnJXdZL --verbose &> quit-failed-log.txtquit-failed-log.txt
I see
CommandService#executeCommand workbench.action.closeWindow"on line 472 andCommandService#executeCommand workbench.action.quit"on line 483. It looks like VS Code is hearing bothcmd+shift+Wandcmd+Q. I think the problem must come from theworkbench.action.quitcommand.bpasero commentedon Feb 1, 2023
Yeah so if
workbench.action.closeWindowcommand runs, then you are basically left with a VS Code app that still runs but has no windows opened. But that should not be a command that runs by default, unless you have keyboard shortcuts defined that are any different from the defaults?jungaretti commentedon Feb 1, 2023
All of my screen recordings show
cmd+shift+Wfollowed bycmd+Q. That's my daily flow and I encounter this bug most when following it. Sorry if that wasn't clear.cmd+Qalone feels more reliable thancmd+shift+Wfollowed bycmd+Q. Here are the logs from using justcmd+Qwhere VS Code quits properly:quit-success.txt
These logs look different than the failure logs. I don't see
closed application storagein the logs where VS Code didn't quit properly.jungaretti commentedon Feb 1, 2023
Maybe there's a race condition between
workbench.action.closeWindowandworkbench.action.quitwhen closing the folder/workspace? I don't seeRequest to stop watchingorstopping file watcherin the failure logs.bpasero commentedon Feb 1, 2023
Oh, what? You press
Cmd+Shift+Wand thenCmd+Q? Would have really helped to indicate this in the beginning.How fast do you press the one after the other?
jungaretti commentedon Feb 1, 2023
My steps to reproduce include the
cmd+shift+Wstep, but my description wasn't accurate. I just edited the issue for clarity.44 remaining items
jungaretti commentedon Feb 21, 2023
Yes, I can repro with the exploration build you shared. I see the same symptoms as stable and insiders. Disabling telemetry with
"telemetry.telemetryLevel": "off"still fixes the problemexploration-telemetry.txt
exploration-no-telemetry.txt
bpasero commentedon Feb 22, 2023
Vincent Dondain (@VincentDondain) for you any special network settings involved? VPN? Proxy?
bpasero commentedon Feb 22, 2023
JP Ungaretti (@jungaretti) out of curiosity because we just made some fundamental changes to the shared process, can you:
window.experimental.sharedProcessUseUtilityProcessin settings to enableddeepak1556 commentedon Feb 22, 2023
This seems to point an issue with the net module in the main process blocking the event loop on pending requests.
JP Ungaretti (@jungaretti) Christian Klaussner (@klaussner) can you try the following settings to confirm if the issue persists, thanks!
bpasero commentedon Feb 22, 2023
👍 worth mentioning though, that in stable we have neither enabled the utility process for shared process nor
developer.sharedProcess.redirectRequestsToMainby default, but its worth a try, maybe one of the users changed the settings.klaussner commentedon Feb 22, 2023
I tested it on two different devices in two locations/networks (without a VPN or firewall) and couldn't see a difference.
The issue persists with these settings. 🙁
I don't know if it helps, but if you monitor the requests sent to the telemetry endpoint with
mitmproxy, you can see that the final requests are handled differently, depending on the timing:VS.Code.telemetry.requests.mp4
jungaretti commentedon Mar 1, 2023
Yes, the issue persists with these settings.
deepak1556 commentedon May 15, 2023
JP Ungaretti (@jungaretti) Christian Klaussner (@klaussner) can you start the application with the following arguments
--trace --trace-category-filter="browser,io,ipc,net,mojom,renderer_host,shutdown,disabled-by-default-lifecycles,disabled-by-default-network", perform the steps below,Ctrl + Shift.+ WCmd + QCmd + Shift + Pand runDeveloper: Stop Tracingjungaretti commentedon May 16, 2023
I'm struggling to repro the bug with
code-insiders, and to fix it incodeI simply disabled telemetry. I'll share the trace as soon as I can.klaussner commentedon May 17, 2023
Same here. I can't reproduce the issue with the latest Insiders build.