-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Start crash reporter inside child processes #27180
Conversation
@ramya-rao-a, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Tyriar and @joaomoreno to be potential reviewers. |
59fa62c
to
b4dfa37
Compare
@ramya-rao-a I suggest to just introduce We still only have one crash reporter process even when we start it from other processes, right? |
Will look into creating ICrashReporterService which can have 2 methods. One to get the args another to start the crash reporter
In Mac which uses crashpad yes. There is a single handler for monitoring crashes for all processes (main, renderer, child) In Windows, we need start another process that does the monitoring. This PR doesn't include that. See https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md#crashreporterstartoptions I'll have to dig a little more to get the more details |
@ramya-rao-a what we could also do as a starter is to only enable this on macOS for e.g. the extension host. |
b4dfa37
to
7fa1ff4
Compare
@bpasero PR updated as we discussed |
@ramya-rao-a I pushed some refactorings and a bugfixes on top of your commit to this PR, please have a look. When trying this out locally I was getting a crash right on startup on the extension host. One thing to look into is your use of From the documentation at https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md#crashreporterstartoptions it was not clear to me how |
Ah! This was due to the object being passed and not the stringified object. That was a last minute change I made as an after thought, but didn't test. Sorry, my bad.
Yes, this should be part of the main payload and not the extra bag. Fixed with 95c8517
Ideally yes. This option is not used by the main/renderer process, so I didn't see the harm in sending it all the time rather than just for the child process. Fixed with 95c8517 btw I spent a lot of time getting the service plumbing to work, but kept getting unhelpful errors while instantiating the ExtensionHostProcessWorker which I then narrowed down to my service not defining "_serviceBrand". Do we have any docs around do's don'ts for such cases? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramya-rao-a looks good now 👍
* Use service to get crash reporter start options * some refactorings and fixes * Move crashesDirectory to the main payload from extra bag
Starting the crash reporter for the extension host
Related to #21944
If this works as expected, we can do the same for the rest of the child processes that we spawn/fork and need crash reporting