Include panic() and std::terminate() info in Sentry crash reports#459
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Sentry tagging for panic messages and uncaught termination exceptions, installs a terminate handler that tags exception type/message before termination, and extends crash tests to exercise panic and destructor-throw termination scenarios. ChangesSentry Crash Reporting
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/libutil/error.cc`:
- Line 456: setSentryTag is being called with msg.data() where msg is a
std::string_view, but std::string_view::data() is not null-terminated; convert
the view to a null-terminated string before passing it to setSentryTag (e.g.,
construct a std::string from msg and pass its c_str()), or alternatively change
setSentryTag to accept a std::string_view and make an internal copy; update the
call site (setSentryTag("panic_msg", msg)) or the setSentryTag implementation so
the value associated with "panic_msg" is always a null-terminated buffer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 17bb80ac-731c-41fa-b04a-e06c950a2cdd
📒 Files selected for processing (4)
src/libutil/error.ccsrc/nix/crash.ccsrc/nix/main.cctests/functional/sentry.sh
Motivation
This includes panic messages and uncaught exception type/message in crash reports.
Context
Summary by CodeRabbit