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

Restart after changing a setting only shuts down #188769

Closed
Tyriar opened this issue Jul 25, 2023 · 16 comments · Fixed by #188268 or #199902
Closed

Restart after changing a setting only shuts down #188769

Tyriar opened this issue Jul 25, 2023 · 16 comments · Fixed by #188268 or #199902
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders verified Verification succeeded windows VS Code on Windows issues

Comments

@Tyriar
Copy link
Member

Tyriar commented Jul 25, 2023

Repro:

  1. Set title bar style from custom -> native
  2. Select restart, 🐛 it shuts down but doesn't start again

Version: 1.81.0-insider (user setup)
Commit: fda9726
Date: 2023-07-25T08:12:53.439Z
Electron: 22.3.17
ElectronBuildId: 22432899
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

@Tyriar
Copy link
Member Author

Tyriar commented Jul 25, 2023

I had screen reader mode on if that matters

@sandy081 sandy081 assigned bpasero and unassigned sandy081 Jul 26, 2023
@sandy081
Copy link
Member

Following API is used to restart

@bpasero
Copy link
Member

bpasero commented Jul 26, 2023

@Tyriar does this reproduce consistently? I think I have seen this once today when I was also testing to change the title style but now I cannot reproduce anymore. I wonder if a pending update could be part of the reason it fails to restart because I think I had a pending update.

//cc @joaomoreno for the update part, I wonder if this has come up before

@bpasero bpasero added the info-needed Issue requires more information from poster label Jul 26, 2023
@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

@bpasero it was yesterday, I just tried again and it also did not start up.

@bpasero
Copy link
Member

bpasero commented Jul 26, 2023

Anything in the logs when you run with --verbose? Does it reproduce running out of sources?

@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

All times I reproduced in Insiders.

Logs here, see it terminated instead of relaunching:

[main 2023-07-26T14:39:27.177Z] Lifecycle#onWillShutdown - end 'instanceLockfile'
[main 2023-07-26T14:39:27.180Z] [UtilityProcess id: 1, type: fileWatcher, pid: 11952]: received exit event with code 0
[main 2023-07-26T14:39:27.180Z] [UtilityProcessWorker]: terminated normally with code 0, signal: unknown
[main 2023-07-26T14:39:27.188Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2023-07-26T14:39:27.189Z] [File Watcher (node.js)] [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\globalStorage
[main 2023-07-26T14:39:27.190Z] StorageMainService: closed workspace storage (11cd0562fd552aa78b92d6894814f6f7)
[main 2023-07-26T14:39:27.190Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.190Z] StorageMainService: closed workspace storage (1d327b9794e29f811edd5e97f31cde5a)
[main 2023-07-26T14:39:27.190Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.190Z] StorageMainService: closed workspace storage (364fa6cda0d57322c8359656b25e5464)
[main 2023-07-26T14:39:27.190Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.190Z] StorageMainService: closed workspace storage (16393023aa659375f2760e3e1aeb56d5)
[main 2023-07-26T14:39:27.190Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.191Z] StorageMainService: closed workspace storage (eef7b424caecd2bf919fa5630ddfb590)
[main 2023-07-26T14:39:27.191Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.191Z] StorageMainService: closed workspace storage (b07b3d603208f714ba143ac906a0984f)
[main 2023-07-26T14:39:27.191Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.203Z] StorageMainService: closed workspace storage (1b927216d3a88da4037d872d0731b799)
[main 2023-07-26T14:39:27.203Z] Lifecycle#onWillShutdown - end 'workspaceStorage'
[main 2023-07-26T14:39:27.216Z] StorageMainService: closed application storage
[main 2023-07-26T14:39:27.216Z] Lifecycle#onWillShutdown - end 'applicationStorage'
[main 2023-07-26T14:39:27.221Z] [UtilityProcess id: 7, type: fileWatcher, pid: 29616]: received exit event with code 0
[main 2023-07-26T14:39:27.221Z] [UtilityProcessWorker]: terminated normally with code 0, signal: unknown
[main 2023-07-26T14:39:27.223Z] [UtilityProcess id: 3, type: fileWatcher, pid: 16348]: received exit event with code 0
[main 2023-07-26T14:39:27.223Z] [UtilityProcessWorker]: terminated normally with code 0, signal: unknown
[main 2023-07-26T14:39:27.274Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\globalStorage
[main 2023-07-26T14:39:27.817Z] resolveShellEnv(): skipped (Windows)
[main 2023-07-26T14:39:27.863Z] [File Watcher (node.js)] [raw] ["change"] sync
[main 2023-07-26T14:39:27.863Z] [File Watcher (node.js)] [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:27.864Z] [File Watcher (node.js)] [raw] ["change"] sync
[main 2023-07-26T14:39:27.864Z] [File Watcher (node.js)] [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:27.874Z] resolveShellEnv(): skipped (Windows)
[main 2023-07-26T14:39:27.944Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:27.986Z] resolveShellEnv(): skipped (Windows)
[main 2023-07-26T14:39:28.074Z] resolveShellEnv(): skipped (Windows)
[main 2023-07-26T14:39:28.100Z] [File Watcher (node.js)] [raw] ["change"] sync
[main 2023-07-26T14:39:28.100Z] [File Watcher (node.js)] [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:28.100Z] [File Watcher (node.js)] [raw] ["change"] sync
[main 2023-07-26T14:39:28.100Z] [File Watcher (node.js)] [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:28.109Z] [File Watcher (node.js)] Request to start watching: c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\profiles\-3dc91576\snippets (excludes: <none>, includes: <all>)
[main 2023-07-26T14:39:28.112Z] [File Watcher (node.js)] Started watching: 'c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\profiles\-3dc91576\snippets'
[main 2023-07-26T14:39:28.182Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\Daniel\AppData\Roaming\Code - Insiders\User\sync
[main 2023-07-26T14:39:28.869Z] [UtilityProcess id: 2, type: extensionHost, pid: 15392]: received exit event with code 0
[main 2023-07-26T14:39:28.869Z] Extension host with pid 15392 exited with code: 0, signal: unknown.
[main 2023-07-26T14:39:28.948Z] [UtilityProcess id: 7, type: extensionHost, pid: 31448]: received exit event with code 0
[main 2023-07-26T14:39:28.948Z] Extension host with pid 31448 exited with code: 0, signal: unknown.
[main 2023-07-26T14:39:28.958Z] resolveShellEnv(): skipped (Windows)
[main 2023-07-26T14:39:28.962Z] [UtilityProcess id: 4, type: extensionHost, pid: 19664]: received exit event with code 0
[main 2023-07-26T14:39:28.962Z] Extension host with pid 19664 exited with code: 0, signal: unknown.
[main 2023-07-26T14:39:29.104Z] [UtilityProcess id: 3, type: extensionHost, pid: 22360]: received exit event with code 0
[main 2023-07-26T14:39:29.104Z] Extension host with pid 22360 exited with code: 0, signal: unknown.
[main 2023-07-26T14:39:29.124Z] [UtilityProcess id: 5, type: extensionHost, pid: 14296]: received exit event with code 0
[main 2023-07-26T14:39:29.124Z] Extension host with pid 14296 exited with code: 0, signal: unknown.
[main 2023-07-26T14:39:29.124Z] Lifecycle#onWillShutdown - end 'extHostStarter'
[main 2023-07-26T14:39:29.126Z] Lifecycle#app.on(will-quit) - after fireOnWillShutdown
[main 2023-07-26T14:39:29.126Z] Lifecycle#app.on(will-quit) - calling app.quit()
[main 2023-07-26T14:39:29.126Z] Lifecycle#relaunch() - calling app.relaunch()
[main 2023-07-26T14:39:30.138Z] [UtilityProcess type: ptyHost, pid: 18484]: received exit event with code 0

~  took 20s
❯

@bpasero
Copy link
Member

bpasero commented Jul 26, 2023

No, it seems to do the right thing:

this.trace('Lifecycle#relaunch() - calling app.relaunch()');
app.relaunch({ args });

This would indicate that Electrons API fails here.

@deepak1556 any clue?

@Tyriar curious if there is possibly a native crash here, can you run with the --crash-reporter-directory=<folder> arg and see if there is a crash dump?

@bpasero bpasero added confirmation-pending and removed info-needed Issue requires more information from poster labels Jul 26, 2023
@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

Weird one for you... It works fine when I set a crash reporter dir, but not without it.

Running this worked when I restarted 3 times:

code-insiders.cmd --verbose --crash-reporter-directory=c:\Users\Daniel\vsc-crash

Running this did not work when I restarted 3 times:

code-insiders.cmd --verbose

@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

I was not seeing crash dumps before, I do see one which I'll DM to you

@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

Just tried with only one window (vscode repo) open and no pty host and it still happens.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 26, 2023

More tests:

  • All builds down to vscode-bisect 1.77 were bad
  • It works fine in stable 1.80.1
  • It does not work in insiders 1.80.0
  • It does not work in user install or archive for insiders

@bpasero
Copy link
Member

bpasero commented Jul 26, 2023

I am still not able to reproduce even on my native Windows Surface machine. I am inclined to close this as out of scope given its not something stable users see.

@Tyriar curious, how is exploration builds for you?

@deepak1556
Copy link
Collaborator

@bpasero or @Tyriar can you forward me the crash dump, I am also unable to repro with insiders.

Couple more follow-up questions,

  1. Is the stable build a user install or system install ?
  2. Does it work fine with portable mode for archive insiders ?
  3. Does it work with user install insiders when you add "disable-chromium-sandbox": true to > Configure runtime arguments ?

@deepak1556 deepak1556 added info-needed Issue requires more information from poster and removed confirmation-pending labels Jul 27, 2023
@Tyriar
Copy link
Member Author

Tyriar commented Jul 27, 2023

@deepak1556 I think it was a red herring as there was only 1 crash dump despite 3 restarts. I'll send regardless

Exploration worked 🤷, hopefully that means insiders will when Electron is updated

@deepak1556 deepak1556 added upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues electron Issues and items related to Electron under-discussion Issue is under discussion for relevance, priority, approach fixed-in-electron-25 Issues fixed with Electron 25.x update and removed info-needed Issue requires more information from poster labels Jul 27, 2023
@bpasero bpasero removed their assignment Jul 27, 2023
@deepak1556 deepak1556 removed insiders-released Patch has been released in VS Code Insiders fixed-in-electron-25 Issues fixed with Electron 25.x update labels Sep 7, 2023
@deepak1556 deepak1556 removed this from the August 2023 milestone Sep 7, 2023
@deepak1556
Copy link
Collaborator

Reopening since issue is present with insiders for @Tyriar

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member and removed under-discussion Issue is under discussion for relevance, priority, approach labels Sep 18, 2023
@deepak1556 deepak1556 added this to the September 2023 milestone Sep 18, 2023
@deepak1556
Copy link
Collaborator

deepak1556 commented Sep 20, 2023

Analysis of the bug is here for reference.

The root issue is that vscode has URI like arguments when setting log level for extensions which has the format <extension-id>:<log-level> and if additional arguments follow this uri like argument then the runtime will abort early on start due to an RCE fix made a long time back GHSA-w222-53c6-c86p

@sandy081 The fix here would be to switch from using uri separator : to something like = or \. Similar kind of arguments can be found in the runtime as well https://source.chromium.org/chromium/chromium/src/+/main:base/logging.h;l=103-123, which use = as separator.

@deepak1556 deepak1556 removed upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron labels Sep 20, 2023
@sandy081 sandy081 modified the milestones: October 2023, Backlog Oct 23, 2023
@sandy081 sandy081 modified the milestones: Backlog, November 2023, December 2023 Dec 3, 2023
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
@bhavyaus bhavyaus added the verified Verification succeeded label Jan 25, 2024
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
7 participants