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

Incorrect crash event fired for termination of filewatcher by SIGTERM #186540

Closed
SimonSiefke opened this issue Jun 28, 2023 · 28 comments
Closed

Incorrect crash event fired for termination of filewatcher by SIGTERM #186540

SimonSiefke opened this issue Jun 28, 2023 · 28 comments
Assignees
Labels
electron Issues and items related to Electron file-watcher File watcher freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Milestone

Comments

@SimonSiefke
Copy link
Contributor

SimonSiefke commented Jun 28, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.79.2
  • OS Version: Ubuntu 23.04

Steps to Reproduce:

  1. Open an empty folder in vscode
  2. Set this as workspace settings json:
{
  "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/.hg/store/**": true,
    "**/.vscode-test-workspace/**": true,
    "**/.vscode-user-data-dir/**": true,
    "**/dist/**": true,
    "**/fixtures/**": true
  }
}
  1. Open the Main Output channel
  2. An error message is dispayed in the output channel: [error] [UtilityProcess id: 1, type: fileWatcher, pid: 28113]: crashed with code 15 and reason 'killed'

See also detailed reproduction steps in https://github.com/SimonSiefke/vscode-file-watcher-crashed

Complete Main Output Channel Logs

2023-06-28 20:16:26.396 [info] update#setState idle
2023-06-28 20:16:30.591 [error] [UtilityProcessWorker]: terminated unexpectedly with code 15, signal: unknown
2023-06-28 20:16:30.592 [error] [UtilityProcess id: 1, type: fileWatcher, pid: 28113]: crashed with code 15 and reason 'killed'
2023-06-28 20:16:30.593 [info] Extension host with pid 28133 exited with code: 0, signal: unknown.
2023-06-28 20:16:56.399 [info] update#setState checking for updates
2023-06-28 20:16:56.403 [info] update#setState idle

Expected behaviour

The file watcher doesn't crash.

Actual behaviour

The file watcher crashes with code 15.

@shijunti19
Copy link

The memory leakage of vscode is too severe, I hope to roll back several versions

It has become so severe that it cannot be used

@bpasero bpasero added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster labels Jun 30, 2023
@bpasero
Copy link
Member

bpasero commented Jun 30, 2023

I cannot reproduce.

Can you please follow the steps in https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues to get at more details around the crash and attach the result here? Thanks!

@SimonSiefke
Copy link
Contributor Author

Please check out this screencast of the issue:

vscode-file-watcher-crash.mp4

And here is the crash dump:

vscode-file-watcher-crash-dump.zip

I hope this helps!

@bpasero bpasero assigned rzhao271 and unassigned bpasero Jun 30, 2023
@bpasero bpasero added electron Issues and items related to Electron and removed info-needed Issue requires more information from poster labels Jun 30, 2023
@rzhao271
Copy link
Contributor

Symbolicated

symbolicated-6c.log

@bpasero
Copy link
Member

bpasero commented Jul 1, 2023

code!blink::mojom::internal::WebPreferences_Data::Validate(void const*, mojo::internal::ValidationContext*) [validation_util.h : 0 + 0x8]
code!content::(anonymous namespace)::FileSystemEntryURLLoader::~FileSystemEntryURLLoader() [sequenced_task_runner.h : 216 + 0xd]
code!perfetto::trace_processor::tables::GpuSliceTable::GpuSliceTable(perfetto::trace_processor::StringPool*, perfetto::trace_processor::tables::SliceTable*) [nullable_vector.h : 169 + 0x11]
code!media::mojom::internal::CodecMetadata_Data::Validate(void const*, mojo::internal::ValidationContext*, bool) [video_encode_accelerator.mojom-shared.cc : 196 + 0x2]
code!media::mojom::internal::CodecMetadata_Data::Validate(void const*, mojo::internal::ValidationContext*, bool) [video_encode_accelerator.mojom-shared.cc : 0 + 0x3]
...

Somehow I feel this stack is unrelated to the issue at hand 🤔

@OrkunTokdemir
Copy link

OrkunTokdemir commented Oct 17, 2023

I get this error too when I run tests. I just initialized a vscode extension according to https://code.visualstudio.com/api/get-started/your-first-extension. If I run npm run test, I get the below crash error.
image

Version: 1.83.1
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:45:31.402Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.2.0-34-generic
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug confirmation-pending labels Oct 17, 2023
@Spyabo
Copy link

Spyabo commented Oct 19, 2023

Opening a vscode window that contains a jupyter notebook .ipynb file causes the window to crash after loading
image
Here are the main logs related to the crash:

2023-10-19 11:34:38.693 [error] [UtilityProcessWorker]: terminated unexpectedly with code 15, signal: unknown
2023-10-19 11:34:38.694 [error] [UtilityProcess id: 2, type: fileWatcher, pid: 20000]: crashed with code 15 and reason 'killed'
2023-10-19 11:34:38.695 [error] ptyHost terminated unexpectedly with code 0
2023-10-19 11:34:38.696 [error] [UtilityProcessWorker]: terminated unexpectedly with code 15, signal: unknown
2023-10-19 11:34:38.696 [error] [UtilityProcess id: 1, type: fileWatcher, pid: 19602]: crashed with code 15 and reason 'killed'
2023-10-19 11:34:38.697 [error] [UtilityProcess type: shared-process, pid: 19601]: crashed with code 15 and reason 'killed'
2023-10-19 11:34:38.704 [info] Extension host with pid 20001 exited with code: 0, signal: unknown.
2023-10-19 11:34:38.704 [error] [UtilityProcess id: 2, type: extensionHost, pid: 20001]: crashed with code 15 and reason 'killed'
2023-10-19 11:34:38.705 [error] CodeWindow: renderer process gone (reason: killed, code: 15)
2023-10-19 11:34:38.994 [error] CodeWindow: renderer process gone (reason: killed, code: 15)
2023-10-19 11:34:39.278 [info] Extension host with pid 19603 exited with code: 15, signal: unknown.
2023-10-19 11:34:39.281 [error] [UtilityProcess id: 1, type: extensionHost, pid: 19603]: crashed with code 15 and reason 'killed'
ProductName: macOS
ProductVersion: 13.5.1
BuildVersion: 22G90

@AngeloGross
Copy link

AngeloGross commented Oct 19, 2023

I've got the same issue opening .ipynb files, but only when the Jupyter Extension is enabled. Specifically, when I create a new .ipynb file, it crashes - without a message.

The main log file states:

2023-10-19 15:03:44.203 [info] update#setState idle
2023-10-19 15:03:48.057 [error] [UtilityProcess type: shared-process, pid: 3461]: crashed with code 15 and reason 'killed'
2023-10-19 15:03:48.059 [info] Extension host with pid 3432 exited with code: 15, signal: unknown.
2023-10-19 15:03:48.059 [error] [UtilityProcess id: 1, type: extensionHost, pid: 3432]: crashed with code 15 and reason 'killed'
2023-10-19 15:03:48.082 [error] CodeWindow: renderer process gone (reason: clean-exit, code: <unknown>)
2023-10-19 15:03:48.226 [error] [UtilityProcess id: 1, type: fileWatcher, pid: 3462]: crashed with code 15 and reason 'killed'

OS: Ubuntu 22.04
VSCode:

1.83.1
f1b07bd25dfad64b0167beb15359ae573aecd2cc
x64

@rzhao271
Copy link
Contributor

@Spyabo @AngeloGross could both of you generate and attach crash reports?
The last one at #186540 (comment) might have been invalid.
See https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues for instructions

@DonJayamanne
Copy link
Contributor

This looks like a duplicate of microsoft/pylance-release#4986

@AngeloGross @Spyabo @OrkunTokdemir @shijunti19 @SimonSiefke
Please revert the version of Pylance extesnion to the previous version.
If that works, then we can close this issue as a duplicate

@AngeloGross
Copy link

@DonJayamanne I actually already installed an older version of VSCode (1.75.1) and it is working now. Which exact version of the pylance extension is making problems? Which previous version should be used?

@anthony-langford
Copy link

Same issue here
image

Version: 1.83.1 (Universal)
Commit: f1b07bd
Date: 2023-10-10T23:46:55.789Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.0.0

@DonJayamanne
Copy link
Contributor

@anthony-langford @AngeloGross @Spyabo
Please could you try installing the previous version of Pylance extension, thats 2023.10.20
Let me know if that works.

@AngeloGross
Copy link

@DonJayamanne
I installed 2023.10.20 and the problem disappeared. Reinstalled the latest version 2023.10.30 and the problem reappeared. In my opinion, it seems that there is a bug in 2023.10.30.

@cgebbe
Copy link

cgebbe commented Oct 20, 2023

@DonJayamanne : Thanks for the tip, seems that it works now with pylance 2023.10.20 !

@rebornix
Copy link
Member

For the crashes caused by Pylance, it's now fixed in latest Pylance release 2023.10.40. You can follow steps in #195617 (comment) to get it updated.

@Spyabo
Copy link

Spyabo commented Oct 23, 2023

@anthony-langford @AngeloGross @Spyabo Please could you try installing the previous version of Pylance extension, thats 2023.10.20 Let me know if that works.

I switched to the pre-release python extension in VSCode and it's all working again

@deepak1556
Copy link
Collaborator

@SimonSiefke can you confirm if the crash is present with 1.84.0, I am unable to confirm with the repro provided.

@bpasero bpasero added this to the April 2024 milestone Apr 19, 2024
@bpasero
Copy link
Member

bpasero commented Apr 19, 2024

Some more investigation today indicates that using utilityProcess.kill() ends up sending an exit code of 15 in certain cases on Linux, at least in VS Codes usages. I am pushing a change to not wrongfully treat this as abnormal termination by keeping track of when we called kill and treating an exit code of 15 as 0 in that case.

@jetm
Copy link

jetm commented Apr 19, 2024

@bpasero Thank you for fixing this. How do we test it? It should not be closed so quickly; at least give us a chance to test it.

@connor4312
Copy link
Member

@jetm you can try this out on VS Code Insiders: https://code.visualstudio.com/insiders/

@connor4312 connor4312 added author-verification-requested Issues potentially verifiable by issue author verification-steps-needed Steps to verify are needed for verification labels Apr 24, 2024
@bpasero bpasero removed the bug Issue identified by VS Code Team member as probable bug label Apr 25, 2024
@bpasero
Copy link
Member

bpasero commented Apr 25, 2024

I am removing the bug label, this was never a real bug (as far as I can tell), but our assumption was wrong. According to @deepak1556 , calling utilityProcess.kill() will trigger a SIGTERM (exit code 15) which we wrongly assumed as being a unexpected crash. I leave it up to him to consider this as something to change in Electron.

I will validate my change next month based on telemetry results where we track utility process crashes, but if someone from the people in this issue see a difference or still believe something is wrong, please speak up.

@jetm
Copy link

jetm commented Apr 25, 2024

I have tried insiders 1714024193, and the crash is still happening. I attached the *.dmp files.
vscode-insiders.zip

@bpasero I still think this is a bug, and it should be treated as one. No crash should happen just by quitting it.

@bpasero bpasero reopened this Apr 26, 2024
@bpasero bpasero assigned deepak1556 and unassigned bpasero Apr 26, 2024
@bpasero bpasero modified the milestones: April 2024, May 2024 Apr 26, 2024
@bpasero bpasero added electron Issues and items related to Electron and removed verification-steps-needed Steps to verify are needed for verification author-verification-requested Issues potentially verifiable by issue author labels Apr 26, 2024
@bpasero
Copy link
Member

bpasero commented Apr 26, 2024

Thanks, I think I should have not hijacked this issue then if there is still a crash happening, reopening.

@bpasero bpasero self-assigned this Apr 26, 2024
@bpasero bpasero added the file-watcher File watcher label Apr 26, 2024
@bpasero
Copy link
Member

bpasero commented Apr 26, 2024

@jetm can you share more details how to exactly reproduce, your setup, your OS, etc.?

@deepak1556
Copy link
Collaborator

I think there is some confusion, the issue has two unrelated crashes being combined.

  1. Filewatcher crash with code 15 - this was due to an incorrect crashed event being fired from the runtime when the process was killed by SIGTERM. @bpasero set out to address this and additionally there will not be any crash dumps generated as it is not a crash in the first place.

  2. Crash reported by @jetm , I have separated it out to SIGSEGV base::AtExitManager::ProcessCallbacksNow() #211422 as it is unrelated to the file watcher. @jetm can you comment in that issue with the data for Incorrect crash event fired for termination of filewatcher by SIGTERM #186540 (comment). Thanks!

@deepak1556 deepak1556 changed the title fileWatcher crashed with code 15 and reason 'killed' Incorrect crash event fired for termination of filewatcher by SIGTERM Apr 26, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron file-watcher File watcher freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Projects
None yet
Development

No branches or pull requests