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]: Blank page on location change / reload if a filesystem asynchronous call was pending #33164
Comments
Getting this too |
Gist version: https://gist.github.com/60969896fee8b6e74450e33309e7974b Related CLs:
We're aware of this, been trying to repro it for a while so thanks! cc @deepak1556 |
Just to add I cant replicate this on 16.1.0 |
@DanielMcAssey correct, it's from a version of V8 introduced in 17. |
@jkleinsc the crash looks unrelated to cppgc and #33252 does not fix this one, reopening for further investigation.
|
@deepak1556 sounds good, i'll dig into it. |
@DanielMcAssey I can repro it starting with 16.0.5 using my above gist. |
Using my repro case, here the result with different versions of Electron:
|
@codebytere to further narrow down the trigger, most of the changes in that PR are guarded behind window opener checks, I think the explicit call to run microtasks
|
|
@deepak1556 yep sorry should have updated this - that's also what I found and have been working to fix! Also not sure if we want to run microtasks, or rather force flush the pending tasks. If we don't run them however it DCHECKs:
reverting to that would fix the crash, but i'd prefer a more proper fix 🤔 |
During the deletion of script context, we make sure to stop running node callbacks electron/shell/common/node_bindings.cc Lines 606 to 610 in 4bdb50e
electron/shell/renderer/electron_renderer_client.cc Lines 150 to 152 in 4bdb50e
RunCleanup which basically will delete all open handles and api wrappers from node.
|
@codebytere The bug persists using electron@18.0.0-beta.4 |
Ho sorry, I was confused by the release note of https://github.com/electron/electron/releases/tag/v18.0.0-beta.4 and random crash in renderer. |
any solution ? |
This was fixed a minor version or 2 ago |
Preflight Checklist
Electron Version
17.1.1
What operating system are you using?
Windows
Operating System Version
Windows 10 21H2
What arch are you using?
x64
Last Known Working Electron version
13.6.9
Expected Behavior
Assuming a BrowserWindow like this:
And an asynchronous filesystem call on
fs.promises
APIThen trying to reload the page when the fs asynchronous call is not finished yet will make the page fail (blank page).
I expect that the page reloads correctly.
Actual Behavior
The page is blank, and DevTools are disconnected.
Testcase Gist URL
No response
Additional Information
Notes:
fs.promises.readFile()
byfs.readFileSync()
and the page will reload finefs.promises.readFile()
byfs.readFile() with callback
and the page will reload finewindow.location.href
https.get()
,timers.promises.setTimeout()
, orfetch()
)I created a repo to reproduce the bug: https://github.com/remss/electron-issue-reload
Just run
npm i && npm start
then click onreloadMeWithAsyncStuff
button to see the blank page.The text was updated successfully, but these errors were encountered: