You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Asynchronous onBeforeRequest callback crashes Chromium with unretained dangling pointer error for specific websites #42505
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
31.0.1
What operating system are you using?
macOS
Operating System Version
macOS Sonoma 14.5
What arch are you using?
x64
Last Known Working Electron version
29.1.1
Expected Behavior
An asynchronous handler to a window's webContents.session.webRequest.onBeforeRequest method should not result in a crash, regardless of the website being navigated to.
Actual Behavior
If there is any asynchrony in the onBeforeRequest handler, attempting to navigate to or within few websites like Adidas-CA, Yahoo results in Chromium crashing with the fatal error: [67617:0614/200604.586896:FATAL:partition_alloc_support.cc(807)] Detected dangling raw_ptr in unretained with id=0x00000138007c37fc:.
Try-catch blocks are not sufficient to keep this error from tearing down the entire application.
Here are the steps to follow to reproduce the issue.
After loading the test Gist in Fiddle, add @electron/remote as a module.
Then, run the application and load Adidas-CA in the browser.
Once the site has loaded, click on the Adidas Icon/logo to renavigate to the home page again.
Anywhere between 1 to 5 clicks, the entire app will crash with an error in the console Detected dangling raw_ptr in unretained with id=0x000001200083e0fc.
The bug lies with multiple stable versions released post v30.0.0. I'm sure there woudl be multiple other websites which if loaded would crash the application. Please look at it at the earliest as we're unable to upgrade our in-Production Electron Application impacting the users.
@amitparida we have hundreds of issues, all with their own distinct impacts to different consumers. My backlog is deep and I will do my best but can make no guarantees.
@codebytere just FYI - in the case of #42149, we don't use the remote module but still get a similar crash. Maybe callstack is different though, didn't check.
Activity
codebytere commentedon Jun 14, 2024
Stacktrace
amitparida commentedon Jun 18, 2024
@codebytere Can we have an update please? Our in-production applications are impacted.
codebytere commentedon Jun 18, 2024
@amitparida we have hundreds of issues, all with their own distinct impacts to different consumers. My backlog is deep and I will do my best but can make no guarantees.
codebytere commentedon Jun 20, 2024
I tracked this to #41490 and it looks like a bug in the remote module (which we heavily discourage using) resultant of a Chrome roll. I rewrote your code using ipc and now see no issues: https://gist.github.com/bc20399ee30acd0f08bdbacbca9a8969, meaning it's not an issue with the callback itself.
pushkin- commentedon Jun 20, 2024
@codebytere just FYI - in the case of #42149, we don't use the remote module but still get a similar crash. Maybe callstack is different though, didn't check.
codebytere commentedon Jun 24, 2024
Folding this into #42149 - they have the same root cause