Skip to content

Crash reporting on Linux is incompatible with sandbox #23124

Closed

Description

@nornagon

On Linux, Electron uses breakpad, as opposed to crashpad which is the crash reporting tool on macOS and Windows. Breakpad requires manually initializing the crash reporter in every process to be monitored, including renderers. Initializing the crash reporter in the renderer currently requires calling crashReporter.start from within the renderer, which can only be done from JavaScript. Initializing the crash reporter requires performing privileged operations, such as installing signal handlers and writing to the filesystem. Thus, when the crash reporter is initialized on Linux in the renderer process, if the sandbox is enabled, the renderer process crashes.

Chromium works around this by enabling the crash reporter before the sandbox is initialized. We'll need to do the same, which means the crash reporter will need to be initialized before JavaScript has the chance to run.

IMO, this is also a good thing for the API, because it would reduce the differences between the crash reporter API on Linux vs. macOS/Windows, and it would mean that crashReporter could become a main-process-only module. It is, however, a breaking change.

Activity

  1. deepak1556 commented on Apr 15, 2020

    @deepak1556
    Member

    that crashReporter could become a main-process-only module. It is, however, a breaking change.

    💯

    This would also eliminate another subtle bug users can run into on windows, if you start the crash reporter in the render process before the crash reporter on browser process , you can mess up the connection pipe to crashpad client https://github.com/electron/electron/blob/master/shell/common/crash_reporter/crash_reporter_win.cc#L91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions