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

[Bug]: stale renderer process on quit #40921

Open
3 tasks done
meteor199 opened this issue Jan 9, 2024 · 4 comments
Open
3 tasks done

[Bug]: stale renderer process on quit #40921

meteor199 opened this issue Jan 9, 2024 · 4 comments
Labels
28-x-y bug 🪲 has-repro-repo Issue can be reproduced by cloning a git repo

Comments

@meteor199
Copy link

meteor199 commented Jan 9, 2024

Preflight Checklist

Electron Version

28.1.2

What operating system are you using?

Windows

Operating System Version

Windows 10 19045.3324

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When the Electron app is closed, there should be no stale renderer processes.

Actual Behavior

After closing the Electron app, a residual renderer process occurs.

Testcase Gist URL

No response

Additional Information

In our Electron application, we use BrowserView. When a particular BrowserView opens a code-server website and then the BrowserWindow is immediately closed and the Electron app is exited, it results in the residual rendering process of that BrowserView. Moreover, this residual process occupies more than 10% of the CPU.

The issue can only be reproduced if the app is closed within 2 seconds of opening the code-server page. If the app is closed a few seconds after opening, the issue does not reoccur

Since this is an internal project, the source code cannot be provided. I attempted to recreate this issue with a minimal example using the same BrowserWindow and BrowserView, but was unable to reproduce it.

This issue is different from that issue : #32888
This is a log recorded by Windows Performance Recorder. It can be analyzed using Windows Performance Analyzer.

https://drive.google.com/file/d/1mAMZTplHOLJJ2LSPODiu8U_5JaDAZdao/view?usp=sharing

The residual process ID is 16036. The actual Electron version is 28.1.2.
image

@meteor199
Copy link
Author

meteor199 commented Jan 9, 2024

Process 16036 has two threads consuming a lot of CPU.
This is thread 22040.
image

This is thread 3232.
image

@jkleinsc jkleinsc added the blocked/need-repro Needs a test case to reproduce the bug label Jan 9, 2024
@electron-issue-triage
Copy link

Hello @meteor199. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@meteor199
Copy link
Author

This is the repository URL :https://github.com/meteor199/issue-electron-stale-renderer-process

How to Start

pnpm i
npm start

After BrowserWindow opens, it will auto-close after 1 second, and then a stale renderer process will appear.

Steps to Reproduce

  1. Open a BrowserWindow
  2. Attach a BrowserView to the BrowserWindow
  3. Add an iframe in the BrowserView, and let the iframe block the process
  4. Once the BrowserView page is displayed, after 1 second, instantly close the window and exit the program. A stale renderer process will appear.

@electron-issue-triage electron-issue-triage bot removed the blocked/need-repro Needs a test case to reproduce the bug label Jan 16, 2024
@meteor199
Copy link
Author

The issue exists with the iframe, whereas the webview is functioning normally.

@jkleinsc jkleinsc added has-repro-repo Issue can be reproduced by cloning a git repo 28-x-y labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
28-x-y bug 🪲 has-repro-repo Issue can be reproduced by cloning a git repo
Projects
None yet
Development

No branches or pull requests

2 participants