Skip to content

fix(crashpad): route client logs through sentry logger - #1859

Merged
jpnurmi merged 7 commits into
masterfrom
jpnurmi/fix/crashpad-log-handler
Jul 16, 2026
Merged

jpnurmi merged 7 commits into
masterfrom
jpnurmi/fix/crashpad-log-handler

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Forward Crashpad client log messages to the Sentry logger instead of stderr. This makes actionable Crashpad handler startup errors due to missing executable permissions, for example, visible in downstream SDKs that only capture Sentry logs, not stderr.

Before:

[sentry] DEBUG starting backend
[sentry] DEBUG background worker thread started
[sentry] DEBUG starting crashpad backend with handler "/Users/jpnurmi/Projects/sentry/sentry-playground/build/crashpad_handler"
[sentry] DEBUG using minidump URL <url>
[55318:16250687:20260713,103346.180970:FATAL spawn_subprocess.cc:222] posix_spawnp /Users/jpnurmi/Projects/sentry/sentry-playground/build/crashpad_handler: Permission denied (13)
[55303:16250469:20260713,103346.181480:WARNING spawn_subprocess.cc:247] intermediate process terminated by signal 5 (Trace/BPT trap: 5)
[55303:16250469:20260713,103346.181562:ERROR file_io.cc:107] ReadExactly: expected 8, observed 0
[sentry] WARN failed to start crashpad client handler
[sentry] WARN failed to initialize backend
[sentry] WARN `sentry_init` failed

After:

[sentry] DEBUG starting backend
[sentry] DEBUG background worker thread started
[sentry] DEBUG starting crashpad backend with handler "/Users/jpnurmi/Projects/sentry/sentry-playground/build/crashpad_handler"
[sentry] DEBUG using minidump URL <url>
[sentry] ERROR crashpad: failed to spawn /Users/jpnurmi/Projects/sentry/sentry-playground/build/crashpad_handler: Permission denied (13)
[sentry] ERROR crashpad: ReadExactly: expected 8, observed 0
[sentry] WARN failed to start crashpad client handler
[sentry] WARN failed to initialize backend
[sentry] WARN `sentry_init` failed

Note: this only applies to the Crashpad client logs. Crashpad handler logs are forwarded to <run>/crashpad-handler.log instead.

Depends on: getsentry/crashpad#159
Resolves: #792

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6a51748. Configure here.

@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/crashpad-log-handler branch 2 times, most recently from ad62ee5 to 1dd333d Compare July 15, 2026 08:15
jpnurmi and others added 7 commits July 16, 2026 08:13
Forward Crashpad client log messages into the Sentry logger when debug
logging is enabled, mapping severities between mini_chromium and Sentry
levels. This makes detailed crashpad_handler startup errors, such as
missing executable permissions, visible.

Resolves: #792
Update Crashpad so spawn and exec failures are reported from the parent
process instead of logging from the forked intermediate child. This keeps
handler startup diagnostics visible without invoking logger callbacks after
fork.

Co-Authored-By: OpenAI Codex <[email protected]>
Forward Crashpad debug logs to the Sentry logger without consuming them.
Disable Crashpad stderr logging for this forwarding path to avoid duplicate
terminal output while keeping fatal termination behavior intact.

Co-Authored-By: OpenAI Codex <[email protected]>
D:\a\***\***\src\backends\sentry_backend_crashpad.cpp(800,13): error C2220: the following warning is treated as an error [C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\cmake3\sentry.vcxproj]
D:\a\***\***\src\backends\sentry_backend_crashpad.cpp(800,13): warning C4100: 'UNUSED_line': unreferenced parameter [C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\cmake3\sentry.vcxproj]
D:\a\***\***\src\backends\sentry_backend_crashpad.cpp(800,13): warning C4100: 'UNUSED_file': unreferenced parameter [C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\cmake3\sentry.vcxproj]
@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/crashpad-log-handler branch from 439b3f3 to d1ef8cc Compare July 16, 2026 06:13

@JoshuaMoelans JoshuaMoelans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean stuff, happy to see all our logs getting unified 🚀

@jpnurmi
jpnurmi merged commit 36f5fd2 into master Jul 16, 2026
100 of 101 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/crashpad-log-handler branch July 16, 2026 09:44
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
sentry-native 0.15.4

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.

- [ ] `resource` blocks have been checked for updates.
<details>
  <summary>release notes</summary>
  <pre>**Features**:

- Add reusable, user-owned scopes. `sentry_scope_new` creates a scope that `sentry_capture_event_with_scope` applies without consuming, so you can configure it once and reuse it across many captures instead of building a new local scope each time. `sentry_scope_clone` copies a scope, and `sentry_scope_free` releases it. ([#1855](getsentry/sentry-native#1855))
- Android: Expose setting the environment on the scope through the NDK bindings via `NativeScope.setEnvironment()`, so head SDKs can sync the environment at runtime. ([#1874](getsentry/sentry-native#1874))
- Embed the crash event's breadcrumbs into session replay recordings, so breadcrumbs from the replay window show up on the replay timeline. ([#1875](getsentry/sentry-native#1875))
- Add `sentry_transaction_discard` and `sentry_span_discard` for releasing unfinished transactions and spans without sending them. ([#1858](getsentry/sentry-native#1858))
- Add scope attributes. `sentry_scope_set_attribute` / `_n` set an attribute on a scope and `sentry_scope_remove_attribute` / `_n` remove one, while the new `sentry_scope_capture_log` and `sentry_scope_capture_metric` capture a log or metric against a given scope. Scope attributes and trace are applied to logs and metrics captured against it, resolving most-specific-first: per-call data, then the scope, then the global scope. ([#1861](getsentry/sentry-native#1861))
- Add `sentry_scope_clear` to reset a scope's data. ([#1881](getsentry/sentry-native#1881))

**Deprecations**:

- Deprecate `sentry_capture_event_with_scope` in favor of `sentry_scope_capture_event` (scope first), which matches `sentry_scope_capture_log` / `sentry_scope_capture_metric`. ([#1882](getsentry/sentry-native#1882))

**Fixes**:

- Apply the propagation context to events that already have contexts set, so that events captured with a local scope or with event-level contexts keep their trace. ([#1843](getsentry/sentry-native#1843))
- Crashpad: reject runtime control IPC from processes other than the one that started the handler. ([#1853](getsentry/sentry-native#1853))
- Native/macOS: resolve symbol names for crash stacktraces from Mach-O symbol tables and dSYM companions. ([#1856](getsentry/sentry-native#1856))
- Route libcurl debug output through the Sentry logger (`SENTRY_TRACE`) instead of writing to `stderr`. ([#1854](getsentry/sentry-native#1854))
  - NOTE: `sentry_options_set_debug(options, true)` no longer displays verbose libcurl debug output by default. To restore it, call `sentry_options_set_logger_level(options, SENTRY_LEVEL_TRACE)`.
- Crashpad: route client logs through the Sentry logger to make actionable handler startup errors visible. ([#1859](getsentry/sentry-native#1859))
- Windows: fix symlink detection used to prevent database cleanup from following symlinks in run and cache directories. ([#1857](getsentry/sentry-native#1857))
- Linux: avoid unsafe `copy_file_range` at crash time. ([#1868](getsentry/sentry-native#1868))
- Increase the default telemetry batcher capacity from 2x100 to 3x100 items, and add `SENTRY_BATCHER_BUFFER_COUNT` to configure the number of rotating buffers used by log and metric batchers. ([#1867](getsentry/sentry-native#1867))
- Fix a lifetime issue when reading `sample_rand` from the scope propagation context. ([#1869](getsentry/sentry-native#1869))
- Linux: silence harmless compilation warnings in `sentry_modulefinder_linux.c` and `sentry_backend_inproc.c`. ([#1871](getsentry/sentry-native#1871))
- Fix per-call log and metric attributes to override same-named global attributes atomically, preventing fields such as `unit` from leaking from the global attribute when the per-call attribute does not define them. ([#1879](getsentry/sentry-native#1879))
- Prefix vendored mpack symbols to avoid symbol conflicts. ([#1880](https://github.com/getsentry/sentry-native/pull/1880))</pre>
  <p>View the full release notes at <a href="https://github.com/getsentry/sentry-native/releases/tag/0.15.4">https://github.com/getsentry/sentry-native/releases/tag/0.15.4</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!14800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check for permissions before starting crashpad

2 participants