* docs: overhaul crash reporting documentation
Add a Crash Reporting tutorial covering how Crashpad collects minidumps,
setting up crashReporter, attaching context with globalExtra and
per-process parameters, reacting to process-gone events, receiving
uploads, symbolicating with Electron's published symbols, and hosted
services.
Correct the crashReporter API reference: value limit is 20320 bytes (not
127) and long keys emit a warning; rateLimit works on all platforms;
ignoreSystemCrashHandler has no effect on Windows; compress: false is
deprecated; getParameters() excludes globalExtra; getUploadedReports()
also lists reports that were not uploaded; Node child processes have no
process.crashReporter.start(); document ptype and _companyName in the
payload; note MAS no-op behaviour; drop the archived mini-breakpad-server
and Mozilla-only Socorro and move hosted services to the tutorial.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: trim implementation details from crash reporting docs
Document behaviour rather than internals so the docs don't become an
accidental API contract: drop the crash dumps directory layout and file
naming, handler process details, Chromium-internal upload fields and
query parameters, exact release asset names and the symbol server path
format, and notes about behaviour from old Electron versions.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: remove privacy section from crash reporting tutorial
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: recommend electron-minidump for symbolication
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: move default values to end of crashReporter option descriptions
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: address crash reporting review feedback
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
* docs: link crashReporter methods in MAS note
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFzbSEnmLgZoxGXgEKSH4i
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: capture __fastfail crashes on Windows via a WER helper module
Crashes raised through __fastfail (STATUS_STACK_BUFFER_OVERRUN: /GS
failures, CFG violations, UCRT abort()) never reach crashpad's in-process
exception filter, so they produced no minidump. Build electron_wer.dll, a
Windows Error Reporting runtime exception helper wrapping crashpad's
crashpad_wer_handler, ship it next to the executable, return its path from
ElectronCrashReporterClient::GetWerRuntimeExceptionModule() so crashpad
registers it in every process, and list it under the current user's
RuntimeExceptionHelperModules key from crashReporter.start() so Windows
will load it without installer changes.
Closes#40363.
* fix: keep WER active in libuv processes and scope helper pruning
libuv's uv_init sets SEM_NOGPFAULTERRORBOX, which stops Windows Error
Reporting from invoking runtime exception helpers, and Electron only
cleared it in the browser process. Clear it in every process type (as
Chromium does) and in ELECTRON_RUN_AS_NODE children after crashpad init,
so __fastfail in Node-integrated renderers, utility processes and workers
reaches electron_wer.dll; add a node-integrated renderer variant of the
spec. Only prune stale RuntimeExceptionHelperModules entries that are
siblings under this app's install root, so crashReporter.start() never
probes other apps' (possibly remote) paths.
* feat: look up the WER helper as <exe name>_wer.dll
Name the helper after the executable so packagers that rename electron.exe
rename the DLL alongside it (myapp.exe -> myapp_wer.dll); the GN output name
is derived from electron_project_name and the docs say so.
* fix: register the WER helper without probing the disk
GetWerRuntimeExceptionModule() runs in sandboxed child processes too, where
the PathExists() check fails and skipped registration (CI: the sandboxed
renderer __fastfail spec got no dump while the unsandboxed one did). Match
Chrome and return the path unconditionally; the browser still checks the
file exists before listing it in the registry.
* fix: let WER run for sandboxed child processes once crashpad is installed
The sandbox job starts children with SEM_NOGPFAULTERRORBOX
(JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION), so the WER helper was never
invoked for a sandboxed renderer's __fastfail. Clear the flag in child
processes right after crashpad initialization.
* refactor: ship crashpad's crashpad_wer.dll as the WER helper
Copy the upstream crashpad_wer loadable module to <exe name>_wer.dll instead
of building a duplicate, keep crashpad_wer.dll itself out of dist.zip, and
resolve the helper's directory from base::DIR_ASSETS (the executable's
directory by default) so apps that version their resources can relocate it.
* fix: increase max crash key value length
* chore: fix linting
* chore: fix linux
* Update spec-main/api-crash-reporter-spec.ts
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
* docs: remove implicit 'any' and 'Object' types from the docs
* docs: more docs improvements, remove all remaining empty interfaces
* chore: update tests for better types
* Initial changes to use crashpad for windows
* Remove crashpad patch
* Report error when failed to connect pipe
* Allow crashpad to communicate with named pipe
* Add patch to make crashpad named pipe work
* Windows also needs crashReporter on main process
* Call SetUnhandledExceptionFilter in node process
Node can also use crash reporter.
* Do not treat node process as browser process
* No more need to manually start crash service
* Use base::StringPrintf for better readbility
* Print error when pipe name not available
* Make sure pipe name is updated
Note that the crashpad may be started after renderer process gets
created.
* Fix some tests
* Update node
* Exclude crashpad files on Linux and MAS
* Fix lint warning
* Remove unused checks
* kCrashpadPipeName is only available on Windows
* Fix uploadToServer tests
* Fix extra params tests
* Fix getCrashesDirectory tests
* Run crashReporter tests on CI
* Style fixes
* Update crashreporter docs
* Rename InitBreakpad to Init
* Add comment for process_type_.empty() and UTF16ToASCII to UTF16ToUTF8.
* Update build.gn include crashpad headers
* Address comment https://github.com/electron/electron/pull/18483#discussion_r290887898
* Avoid using api::WebContents
* Put kRunAsNode in atom_constants
* Remove duplicate settings on upload params
* Fix building on macOS
* Update description for crashpad_pid_check.patch