Skip to content

Conversation

nornagon
Copy link
Contributor

@nornagon nornagon commented May 7, 2020

Backport of #23265.

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.

@nornagon nornagon requested a review from a team as a code owner May 7, 2020 21:13
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label May 7, 2020
@trop trop bot added 9-x-y backport This is a backport PR labels May 7, 2020
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label May 7, 2020
@nornagon nornagon merged commit 2f81508 into 9-x-y May 8, 2020
@release-clerk
Copy link

release-clerk bot commented May 8, 2020

Release Notes Persisted

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.

@nornagon nornagon deleted the backport/9-x-y/crash-reporter-refactor branch May 8, 2020 18:41
@vyunikov
Copy link

Does crashReporter get initialized in child processes created using child_process module?
If not, how can I use it in the case I mentioned?

@nornagon
Copy link
Contributor Author

@vyunikov on Linux, it does not. I don't know what use case you are talking about.

To initialize the crash reporter in a Node child process on Linux, you'll need to use process.crashReporter.start(). Sadly this doesn't seem to be documented anywhere, I'll update the docs soon. You can see an example in our tests.

@nornagon
Copy link
Contributor Author

Ref #25579

@vyunikov
Copy link

@nornagon Thanks for your response. Sorry, I was probably a bit unclear.
My app works on Mac and Windows and I need to enable crash reporting on these platforms.
On Windows process.crashReporter.start() seems to be unavailable. Looks like child process only has access to those 3 crashReporter methods: getParameters, addExtraParameter, removeExtraParameter

@nornagon
Copy link
Contributor Author

nornagon commented Sep 23, 2020

process.crashReporter.start() is only relevant in node child processes and only on Linux. On Windows and Mac, Crashpad automatically monitors child processes when initialized in the main process.

@vyunikov
Copy link

@nornagon I am using Electron 9.2.0 and it doesn't look like crashReporter monitors my child process when initialized in main one. At least I see that crashes in main and renderer are reporter correctly, but there's no report for the crash in my child process.
Does Crashpad monitor child processes in this Electron version?

@nornagon
Copy link
Contributor Author

@vyunikov perhaps you could open a new issue with a small repro illustrating the issue you're having?

@vyunikov
Copy link

Will do, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9-x-y backport This is a backport PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants