Skip to content

fix: crashReporter incompatible with sandbox on Linux (#23265) - #23461

Merged
nornagon merged 11 commits into
9-x-yfrom
backport/9-x-y/crash-reporter-refactor
May 8, 2020
Merged

nornagon merged 11 commits into
9-x-yfrom
backport/9-x-y/crash-reporter-refactor

Conversation

@nornagon

@nornagon nornagon commented May 7, 2020

Copy link
Copy Markdown
Contributor

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

release-clerk Bot commented May 8, 2020

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

Ref #25579

@vyunikov

Copy link
Copy Markdown

@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

nornagon commented Sep 23, 2020 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown

@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
Copy Markdown
Contributor Author

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

@vyunikov

Copy link
Copy Markdown

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