microsoft / vscode

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

VS Code crashes when launching as administrator #184928

Closed yutao-huang closed 1 year ago

yutao-huang commented 1 year ago

Type: Bug

From today, VS Code started to crash when launching as adminstrator. The error dialog says The window terminated unexpectedly (reason: 'launch-failed', code: '18').

I tried launching it with --disable-extensions or --no-sandbox but none helped.

Launching in user mode is fine.

Below is the output with --verbose:

[main 2023-06-12T17:12:43.613Z] PolicyConfiguration#initialize
[main 2023-06-12T17:12:43.615Z] PolicyConfiguration#updatePolicyDefinitions [
  'http.proxy',
  'http.proxyStrictSSL',
  'http.proxyAuthorization',
  'http.proxySupport',
  'http.systemCertificates',
  'telemetry.telemetryLevel',
  'telemetry.enableTelemetry',
  'update.mode',
  'update.channel',
  'update.enableWindowsBackgroundUpdates',
  'update.showReleaseNotes'
]
[main 2023-06-12T17:12:43.617Z] NativePolicyService#_updatePolicyDefinitions - Found 1 policy definitions
[main 2023-06-12T17:12:43.621Z] [File Watcher (node.js)] Request to start watching: c:\Users\REDACTED\AppData\Roaming\Code\User (excludes: <none>, includes: <all>),c:\Users\REDACTED\AppData\Roaming\Code\User\settings.json (excludes: <none>, includes: <all>)
[main 2023-06-12T17:12:43.623Z] NativePolicyService#_onDidPolicyChange - Updated policy values: {}
[main 2023-06-12T17:12:43.623Z] PolicyConfiguration#update [ 'update.mode' ]
[main 2023-06-12T17:12:43.641Z] Starting VS Code
[main 2023-06-12T17:12:43.641Z] from: c:\Program Files\Microsoft VS Code\resources\app
[main 2023-06-12T17:12:43.641Z] args: {
  _: [ 'D:\\REDACTED\\REDACTED' ],
  diff: false,
  merge: false,
  add: false,
  goto: false,
  'new-window': false,
  'reuse-window': false,
  wait: false,
  help: false,
  'list-extensions': false,
  'show-versions': false,
  'pre-release': false,
  version: false,
  verbose: true,
  status: false,
  'prof-startup': false,
  'no-cached-data': false,
  'prof-v8-extensions': false,
  'disable-extensions': false,
  'disable-gpu': false,
  'ms-enable-electron-run-as-node': false,
  telemetry: false,
  debugRenderer: false,
  'enable-smoke-test-driver': false,
  logExtensionHostCommunication: false,
  'skip-release-notes': false,
  'skip-welcome': false,
  'disable-telemetry': false,
  'disable-updates': false,
  'disable-keytar': false,
  'disable-workspace-trust': false,
  'disable-crash-reporter': false,
  'crash-reporter-id': '6649d314-824a-48c3-a456-9aeded7e488c',
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  force: false,
  'do-not-sync': false,
  trace: false,
  'force-user-env': false,
  'force-disable-user-env': false,
  'open-devtools': false,
  'disable-gpu-sandbox': false,
  '__enable-file-policy': false,
  'enable-coi': false,
  'no-proxy-server': false,
  'no-sandbox': false,
  nolazy: false,
  'force-renderer-accessibility': false,
  'ignore-certificate-errors': false,
  'allow-insecure-localhost': false,
  'disable-dev-shm-usage': false,
  'profile-temp': false,
  logsPath: 'C:\\Users\\REDACTED\\AppData\\Roaming\\Code\\logs\\20230612T101243'
}
[main 2023-06-12T17:12:43.642Z] Resolving machine identifier...
[main 2023-06-12T17:12:43.643Z] Resolved machine identifier: a8ab2b576001bfa5ef58f0723fbe43cf2bea2de1b197cf43e6e6dd7ec910372f
[main 2023-06-12T17:12:43.643Z] Main->SharedProcess#connect
[main 2023-06-12T17:12:43.644Z] PolicyConfiguration#updatePolicyDefinitions [
  'terminal.integrated.automationShell.linux',
  'terminal.integrated.automationShell.osx',
  'terminal.integrated.automationShell.windows',
  'terminal.integrated.automationProfile.linux',
  'terminal.integrated.automationProfile.osx',
  'terminal.integrated.automationProfile.windows',
  'terminal.integrated.shell.linux',
  'terminal.integrated.shell.osx',
  'terminal.integrated.shell.windows',
  'terminal.integrated.shellArgs.linux',
  'terminal.integrated.shellArgs.osx',
  'terminal.integrated.shellArgs.windows',
  'terminal.integrated.profiles.windows',
  'terminal.integrated.profiles.osx',
  'terminal.integrated.profiles.linux',
  'terminal.integrated.useWslProfiles',
  'terminal.integrated.inheritEnv',
  'terminal.integrated.persistentSessionScrollback',
  'terminal.integrated.showLinkHover',
  'terminal.integrated.ignoreProcessNames'
]
[main 2023-06-12T17:12:43.645Z] PolicyConfiguration#updatePolicyDefinitions [
  'terminal.integrated.defaultProfile.linux',
  'terminal.integrated.defaultProfile.osx',
  'terminal.integrated.defaultProfile.windows'
]
[main 2023-06-12T17:12:43.650Z] PolicyConfiguration#update []
[main 2023-06-12T17:12:43.650Z] PolicyConfiguration#update []
[main 2023-06-12T17:12:43.657Z] StorageMainService: creating application storage
[main 2023-06-12T17:12:43.663Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2023-06-12T17:12:43.663Z] lifecycle (main): phase changed (value: 2)
[main 2023-06-12T17:12:43.664Z] windowsManager#open
[main 2023-06-12T17:12:43.666Z] windowsManager#open pathsToOpen [
  {
    workspace: { id: '760c2dc1d3cb42084107fa7295494224', uri: [s] },
    type: 2,
    exists: true
  }
]
[main 2023-06-12T17:12:43.667Z] windowsManager#doOpenFolderOrWorkspace {
  folderOrWorkspace: {
    workspace: { id: '760c2dc1d3cb42084107fa7295494224', uri: [s] },
    type: 2,
    exists: true
  },
  filesToOpen: undefined
}
[main 2023-06-12T17:12:43.669Z] IPC Object URL: Registered new channel vscode:ba8ac19b-b5db-4dd3-b580-f5416d56737e.
[main 2023-06-12T17:12:43.669Z] window#validateWindowState: validating window state on 3 display(s) { mode: 0, x: 448, y: 216, width: 1024, height: 768 }
[main 2023-06-12T17:12:43.670Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 1920, height: 1160 }
[main 2023-06-12T17:12:43.670Z] window#ctor: using window state { mode: 0, x: 448, y: 216, width: 1024, height: 768 }
[main 2023-06-12T17:12:43.783Z] window#load: attempt to load window (id: 1)
[main 2023-06-12T17:12:43.801Z] StorageMainService: creating workspace storage (760c2dc1d3cb42084107fa7295494224)
[main 2023-06-12T17:12:43.802Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 1, emptyToRestore: 0, emptyToOpen: 0)
[main 2023-06-12T17:12:43.802Z] lifecycle (main): phase changed (value: 3)
[main 2023-06-12T17:12:43.808Z] resolveShellEnv(): skipped (Windows)
[main 2023-06-12T17:12:43.809Z] update#setState idle
Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[main 2023-06-12T17:12:43.850Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18)
[main 2023-06-12T17:12:43.874Z] [File Watcher (node.js)] Started watching: 'c:\Users\REDACTED\AppData\Roaming\Code\User'
[12384:0612/101243.882:INFO:electron_api_web_frame_main.cc(235)] Attempt to setup WebFrameMain connection while render frame is disposed
Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[main 2023-06-12T17:12:43.896Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18)
[main 2023-06-12T17:12:43.899Z] [File Watcher (node.js)] Started watching: 'c:\Users\REDACTED\AppData\Roaming\Code\User\settings.json'
[main 2023-06-12T17:12:43.986Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2023-06-12T17:12:43.986Z] [File Watcher (node.js)] [CHANGED] c:\Users\REDACTED\AppData\Roaming\Code\User\globalStorage
[main 2023-06-12T17:12:43.987Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2023-06-12T17:12:43.987Z] [File Watcher (node.js)] [CHANGED] c:\Users\REDACTED\AppData\Roaming\Code\User\globalStorage
[main 2023-06-12T17:12:44.063Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\REDACTED\AppData\Roaming\Code\User\globalStorage
[main 2023-06-12T17:12:45.299Z] IPC Object URL: Removed channel vscode:ba8ac19b-b5db-4dd3-b580-f5416d56737e.
[main 2023-06-12T17:12:45.299Z] Lifecycle#window.on('closed') - window ID 1
[main 2023-06-12T17:12:45.299Z] Lifecycle#onWillShutdown.fire()
[main 2023-06-12T17:12:45.300Z] Lifecycle#onWillShutdown - begin 'instanceLockfile'
[main 2023-06-12T17:12:45.301Z] [SharedProcess] onWillShutdown
[main 2023-06-12T17:12:45.301Z] storageMainService#onWillShutdown()
[main 2023-06-12T17:12:45.301Z] Lifecycle#onWillShutdown - begin 'applicationStorage'
[main 2023-06-12T17:12:45.301Z] Lifecycle#onWillShutdown - begin 'workspaceStorage'
[main 2023-06-12T17:12:45.301Z] Lifecycle#onWillShutdown - begin 'extHostStarter'
[main 2023-06-12T17:12:45.301Z] Lifecycle#app.on(window-all-closed)
[main 2023-06-12T17:12:45.302Z] Lifecycle#app.on(before-quit)
[main 2023-06-12T17:12:45.302Z] Lifecycle#onBeforeShutdown.fire()
[main 2023-06-12T17:12:45.302Z] [WindowsStateHandler] onBeforeShutdown {
  lastActiveWindow: {
    workspaceIdentifier: undefined,
    folder: 'file:///d%3A/REDACTED/REDACTED',
    backupPath: 'C:\\Users\\REDACTED\\AppData\\Roaming\\Code\\Backups\\19799fbd031089d0f85f2566de6dab6e',
    remoteAuthority: undefined,
    uiState: [Object: null prototype] {
      mode: 0,
      x: 448,
      y: 216,
      width: 1024,
      height: 768
    }
  },
  lastPluginDevelopmentHostWindow: undefined,
  openedWindows: []
}
[main 2023-06-12T17:12:45.303Z] Lifecycle#app.on(will-quit) - begin
[main 2023-06-12T17:12:45.305Z] windowsManager#open
[main 2023-06-12T17:12:45.306Z] Lifecycle#onWillShutdown - end 'extHostStarter'
[main 2023-06-12T17:12:45.310Z] [File Watcher (node.js)] Request to stop watching: c:\Users\REDACTED\AppData\Roaming\Code\User,c:\Users\REDACTED\AppData\Roaming\Code\User\settings.json
[main 2023-06-12T17:12:45.310Z] [File Watcher (node.js)] stopping file watcher on c:\Users\REDACTED\AppData\Roaming\Code\User
[main 2023-06-12T17:12:45.311Z] [File Watcher (node.js)] stopping file watcher on c:\Users\REDACTED\AppData\Roaming\Code\User\settings.json
[main 2023-06-12T17:12:45.316Z] Lifecycle#onWillShutdown - end 'instanceLockfile'
[main 2023-06-12T17:12:45.316Z] windowsManager#open pathsToOpen [
  {
    workspace: { id: '760c2dc1d3cb42084107fa7295494224', uri: [s] },
    type: 2,
    exists: true,
    label: undefined
  }
]
[main 2023-06-12T17:12:45.316Z] windowsManager#doOpenFolderOrWorkspace {
  folderOrWorkspace: {
    workspace: { id: '760c2dc1d3cb42084107fa7295494224', uri: [s] },
    type: 2,
    exists: true,
    label: undefined
  },
  filesToOpen: undefined
}
[main 2023-06-12T17:12:45.317Z] IPC Object URL: Registered new channel vscode:a4f2f15e-092c-41c4-b71e-daef9e994436.
[main 2023-06-12T17:12:45.317Z] window#validateWindowState: validating window state on 3 display(s) [Object: null prototype] {
  mode: 0,
  x: 448,
  y: 216,
  width: 1024,
  height: 768
}
[main 2023-06-12T17:12:45.317Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 1920, height: 1160 }
[main 2023-06-12T17:12:45.318Z] window#ctor: using window state [Object: null prototype] {
  mode: 0,
  x: 448,
  y: 216,
  width: 1024,
  height: 768
}
[main 2023-06-12T17:12:45.454Z] window#load: attempt to load window (id: 2)
[main 2023-06-12T17:12:45.479Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 1, emptyToRestore: 0, emptyToOpen: 0)
Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[main 2023-06-12T17:12:45.505Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18)
[main 2023-06-12T17:12:45.526Z] StorageMainService: closed workspace storage (760c2dc1d3cb42084107fa7295494224)
[main 2023-06-12T17:12:45.527Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-06-12T17:12:45.527Z] StorageMainService: closed application storage
[main 2023-06-12T17:12:45.527Z] Lifecycle#onWillShutdown - end 'applicationStorage'
[main 2023-06-12T17:12:45.551Z] Lifecycle#app.on(will-quit) - after fireOnWillShutdown
[main 2023-06-12T17:12:45.551Z] Lifecycle#app.on(will-quit) - calling app.quit()
[main 2023-06-12T17:12:45.551Z] Lifecycle#window.on('close') - window ID 2
[main 2023-06-12T17:12:45.552Z] Lifecycle#onBeforeCloseWindow.fire() - window ID 2
Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[main 2023-06-12T17:12:45.558Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18)
[main 2023-06-12T17:12:45.576Z] IPC Object URL: Removed channel vscode:a4f2f15e-092c-41c4-b71e-daef9e994436.
[main 2023-06-12T17:12:45.576Z] Lifecycle#window.on('closed') - window ID 2

VS Code version: Code 1.79.0 (b380da4ef1ee00e224a15c1d4d9793e27c2b6302, 2023-06-07T14:26:35.552Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) CPU E5-1680 v4 @ 3.40GHz (16 x 3392)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|63.90GB (44.76GB free)| |Process Argv|--folder-uri file:///d%3A/ado/MakerService --crash-reporter-id 6649d314-824a-48c3-a456-9aeded7e488c| |Screen Reader|no| |VM|0%|
Extensions (117) Extension|Author (truncated)|Version ---|---|--- language-x86-64-assembly|13x|3.0.0 vscode-openapi|42C|4.18.2 better-comments|aar|3.0.2 string-converter|ada|0.1.2 vscode-sql-formatter|adp|1.4.4 Bookmarks|ale|13.3.1 project-manager|ale|12.7.0 swagger-viewer|Arj|3.1.2 armview|ben|0.4.6 markdown-footnotes|bie|0.1.1 markdown-mermaid|bie|1.18.1 markdown-preview-github-styles|bie|2.0.2 jsonviewer|cci|1.3.2 npm-intellisense|chr|1.4.4 codeswing|cod|0.0.21 gitignore|cod|0.9.0 supersharp|cra|0.1.4 doxdocgen|csc|1.4.0 transformer|dak|1.12.1 vscode-markdownlint|Dav|0.50.0 vscode-eslint|dba|2.4.0 git-extension-pack|don|0.1.3 githistory|don|0.6.20 xml|Dot|2.5.1 gitlens|eam|13.6.0 vscode-npm-script|eg2|0.3.29 prettier-vscode|esb|9.13.0 vs-sharper|ese|0.2.0 vs-code-xml-format|fab|0.1.5 macros|ged|1.2.1 copilot|Git|1.89.156 copilot-labs|Git|0.14.884 go|gol|0.38.0 vscode-test-explorer|hbe|2.21.1 notejs|hen|0.0.24 codesnap-plus|hui|1.4.1 rest-client|hum|0.25.1 better-cpp-syntax|jef|1.17.2 svg|joc|1.5.2 vscode-peacock|joh|4.2.2 cmake-language-support-vscode|jos|0.0.9 docomment|k--|1.0.0 marp-vscode|mar|2.6.0 git-graph|mhu|1.30.0 vscode-tsc|Moh|1.0.2 pull-request-quantifier|ms-|0.1.2 azure-pipelines|ms-|1.208.0 vscode-azureappservice|ms-|0.24.9 vscode-azurefunctions|ms-|1.11.0 vscode-azureresourcegroups|ms-|0.7.5 vscode-azurestaticwebapps|ms-|0.12.1 vscode-azurestorage|ms-|0.15.2 vscode-cosmosdb|ms-|0.19.4 vscode-docker|ms-|1.25.1 vscode-logicapps|ms-|1.2.7 vscode-service-fabric-reliable-services|ms-|0.1.6 blazorwasm-companion|ms-|1.1.4 csharp|ms-|1.25.9 dotnet-interactive-vscode|ms-|1.0.4308020 vscode-dotnet-runtime|ms-|1.6.0 vscode-edge-devtools|ms-|2.1.2 isort|ms-|2022.8.0 python|ms-|2023.10.0 vscode-pylance|ms-|2023.6.10 jupyter|ms-|2023.5.1001582324 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.15 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.295.0 remote-ssh|ms-|0.102.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.79.4 vscode-remote-extensionpack|ms-|0.24.0 azure-account|ms-|0.11.5 azurecli|ms-|0.5.0 cmake-tools|ms-|1.14.33 cpptools|ms-|1.15.4 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.11 mock-debug|ms-|0.52.0 powershell|ms-|2023.6.0 remote-explorer|ms-|0.4.0 remote-server|ms-|1.2.1 test-adapter-converter|ms-|0.1.8 azurerm-vscode-tools|msa|0.15.10 vscode-paste-image|mus|1.0.4 vs-qalc|nor|0.1.12 brewdown-vscode|off|0.0.2 homebrewery-vscode|off|0.1.1 docthis|oou|0.8.2 vscode-jest|Ort|5.2.3 vscode-auto-scroll|pej|1.1.0 postman-for-vscode|Pos|0.2.0 text-power-tools|qcz|1.40.2 vscode-thunder-client|ran|2.7.6 vscode-yaml|red|1.13.0 vscode-sort-json|ric|1.20.0 vscode-json-validate|rio|1.4.3 LiveServer|rit|5.7.9 kuskus-kusto-syntax-highlighting|ros|1.1.21 markdown-preview-enhanced|shd|0.6.8 indenticator|Sir|0.7.0 abc-music|sof|0.4.0 guides|spy|0.9.3 code-spell-checker|str|2.20.5 vscode-styled-components|sty|1.7.8 cmake|twx|0.0.17 luna-paint|Tyr|0.16.0 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-manifest-yaml|vmw|1.46.0 codetour|vsl|0.0.59 vscode-todo-highlight|way|1.0.5 search|Wsc|1.0.37 markdown-all-in-one|yzh|3.5.1 vscode-open-in-github|ziy|1.3.6 (6 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vscaac:30438847 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30610678 2e4cg342:30602488 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 03d35959:30757346 pythonfmttext:30731395 pythoncmvfstrcf:30756944 fixshowwlkth:30730052 showsbindicator:30760979 pythongtdpathcf:30739705 dh2dc718:30763024 ```
DavidShield commented 1 year ago

I have the same issue.

Treit commented 1 year ago

I have been seeing the same thing. Launching vscode from a terminal window running as administrator no longer works:

image

I have window.experimental.useSandbox set to false in my settings.config, so that should allow vscode to run as administrator. (Previously I hit the issue where it would say "running as administrtator is not supported" until I added that setting.)

paulcallen commented 1 year ago

Same problem with Code 1.79.0 CodeWindow: renderer process gone (reason: launch-failed, code: 18) I have uninstalled, reinstalled, deleted as many code files as I could possibly find with a clean install and always get the same error. Only happens when running as an elevated user, runs find as regular user.

deepak1556 commented 1 year ago

/duplicate https://github.com/microsoft/vscode/issues/184687