-
Notifications
You must be signed in to change notification settings - Fork 16.4k
fix: crashReporter incompatible with sandbox on Linux #23265
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
Conversation
Hm, might be able to make this change not-breaking, just a deprecation, and break it in v12.
This would be nice to give a softer landing to this feature. |
I disabled some tests on ARM. I manually verified that the crash reporter does in fact function correctly at least some of the time on linux/arm64. On linux/arm32, I had issues with crash reports in the main process, though renderer-side crash reports seemed fine. I'd like to get these tests fixed, but given the crash reporter seems to mostly work on arm outside of a CI environment, and this PR enables more tests than were previously enabled on those platforms, I'm OK merging and continuing work on fixing the tests in a followup. |
CI failures are unrelated. merging. |
Release Notes Persisted
|
I was unable to backport this PR to "9-x-y" cleanly; |
Description of Change
This refactors
crashReporter
, making the following changes:crashReporter.start
from the renderer process is now deprecated, and only has the effect of setting extra parameters. Child processes will be automatically tracked if they're started after the crash reporter is initialized in the main process.getLastCrashReport
,getUploadedReports
,getUploadToServer
,setUploadToServer
, andgetCrashesDirectory
are also deprecated in the renderer process. OnlyaddExtraParameter
,removeExtraParameter
andgetParameters
remain non-deprecated in the renderer.crashReporter.start
calledglobalExtra
. Parameters passed in here will be included with any crash reported from any process, but cannot be changed after initialization. Parameters inextra
or added byaddExtraParameter
will be included only with crashes in the process in which they're added, and they can be changed dynamically, as before. By default, the product name and app version (as reported byapp.getVersion()
when the crash reporter is started) are included in the global extra parameters.companyName
parameter is no longer required, and further, is deprecated.All above deprecated options will be removed in v12.x, and the majority of the
crashReporter
API will become main-process-only.The reasons for making this change are as follows.
crashReporter.start()
in the renderer, but when the sandbox is engaged,crashReporter.start()
cannot run on Linux. The only way to resolve this is to enable the crash reporter before the sandbox is engaged, which means before JavaScript is able to run. Thus, all the configuration must come from the main process.crashReporter.start()
from a renderer process without having first initialized the crash reporter in the main process will not result in crashes being collected from that renderer, as crashpad won't have been initialized when the renderer was launched.crashReporter.start()
is ignored if the crash reporter is already enabled, including thesubmitURL
parameter, despite it being a required parameter in the API.Fixes #23124.
Checklist
npm test
passesRelease Notes
Notes:
crashReporter
is now explicitly initialized only in the main process, and implicitly initialized in other child processes. This fixes an issue preventing the crash reporter from functioning in sandboxed renderers on Linux.