From 8675181d4d8d522f0b1b6c1647e4d3835a2a6a17 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 20 Jun 2023 16:23:33 +0200 Subject: [PATCH 1/7] default level 'fatal' --- src/backends/sentry_backend_crashpad.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index b3bc19440..6b3a46ee2 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -149,6 +149,8 @@ sentry__crashpad_handler(int signum, siginfo_t *info, ucontext_t *user_context) auto *data = static_cast(options->backend->data); sentry_value_decref(data->crash_event); data->crash_event = sentry_value_new_event(); + sentry_value_set_by_key(data->crash_event, "level", + sentry__value_new_level(SENTRY_LEVEL_FATAL)); if (options->on_crash_func) { sentry_ucontext_t uctx; From 420ceadf0bc28f96ff7ac3ef55201c82319c2ae5 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 21 Jun 2023 14:21:00 +0200 Subject: [PATCH 2/7] Updated CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d27f7bd31..b25292651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +**Fixes**: + +- Events captured by Crashpad are initialized with level `FATAL` ([#852](https://github.com/getsentry/sentry-native/pull/852)) + **Features**: - crashpad_handler: log `body` if minidump endpoint response is not `OK` ([#851](https://github.com/getsentry/sentry-native/pull/851), [crashpad#87](https://github.com/getsentry/crashpad/pull/87)) From 5fceccbfb6f1632f82d5284aa025bfd019bcba6b Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 22 Jun 2023 15:15:24 +0200 Subject: [PATCH 3/7] setting default values for crash events --- src/backends/sentry_backend_breakpad.cpp | 2 ++ src/backends/sentry_backend_crashpad.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/backends/sentry_backend_breakpad.cpp b/src/backends/sentry_backend_breakpad.cpp index 1c22e43e9..aefe66012 100644 --- a/src/backends/sentry_backend_breakpad.cpp +++ b/src/backends/sentry_backend_breakpad.cpp @@ -92,6 +92,8 @@ sentry__breakpad_backend_callback( dump_path = sentry__path_new(descriptor.path()); #endif sentry_value_t event = sentry_value_new_event(); + sentry_value_set_by_key( + event, "level", sentry__value_new_level(SENTRY_LEVEL_FATAL)); SENTRY_WITH_OPTIONS (options) { sentry__write_crash_marker(options); diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index 6b3a46ee2..c4328e85a 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -105,9 +105,12 @@ crashpad_backend_flush_scope( // properties that we do not want here. But in case of a crash we use the // crash-event filled in the crash-handler and on_crash/before_send // respectively. - sentry_value_t event = sentry_value_is_null(data->crash_event) - ? sentry_value_new_object() - : data->crash_event; + sentry_value_t event = data->crash_event; + if (sentry_value_is_null(event)) { + event = sentry_value_new_object(); + sentry_value_set_by_key( + event, "level", sentry__value_new_level(SENTRY_LEVEL_FATAL)); + } SENTRY_WITH_SCOPE (scope) { // we want the scope without any modules or breadcrumbs From e967d1295ab117c2cd2f96c2e6f0605b673c52df Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 22 Jun 2023 15:16:17 +0200 Subject: [PATCH 4/7] Updated CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b25292651..7fa41a0a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ **Fixes**: -- Events captured by Crashpad are initialized with level `FATAL` ([#852](https://github.com/getsentry/sentry-native/pull/852)) +- Crash events are initialized with level `FATAL` ([#852](https://github.com/getsentry/sentry-native/pull/852)) **Features**: From f77f38e1645dddcb5a2429faddb68e8a9962e008 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 22 Jun 2023 17:39:37 +0200 Subject: [PATCH 5/7] fixme comment --- src/backends/sentry_backend_crashpad.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index c4328e85a..7a0a7d0d6 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -108,6 +108,8 @@ crashpad_backend_flush_scope( sentry_value_t event = data->crash_event; if (sentry_value_is_null(event)) { event = sentry_value_new_object(); + // FIXME: This should be handled in the FirstChanceHandler but that does + // not exist for macOS just yet. sentry_value_set_by_key( event, "level", sentry__value_new_level(SENTRY_LEVEL_FATAL)); } From 3c85ee76e71466ab2232967f7b938fd9e805b2bf Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Fri, 23 Jun 2023 11:26:02 +0200 Subject: [PATCH 6/7] removed duplicate session handling --- src/backends/sentry_backend_breakpad.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/backends/sentry_backend_breakpad.cpp b/src/backends/sentry_backend_breakpad.cpp index aefe66012..40dc6a189 100644 --- a/src/backends/sentry_backend_breakpad.cpp +++ b/src/backends/sentry_backend_breakpad.cpp @@ -118,9 +118,6 @@ sentry__breakpad_backend_callback( if (should_handle) { sentry_envelope_t *envelope = sentry__prepare_event( options, event, nullptr, !options->on_crash_func); - // the event we just prepared is empty, - // so no error is recorded for it - sentry__record_errors_on_current_session(1); sentry_session_t *session = sentry__end_current_session_with_status( SENTRY_SESSION_STATUS_CRASHED); sentry__envelope_add_session(envelope, session); From 3f21f14713bd48769d9e135f8adbf2ff6a43c0f9 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 23 Jun 2023 12:10:55 +0200 Subject: [PATCH 7/7] Update changelog for release --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa41a0a8..c3e43821f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,18 @@ **Fixes**: - Crash events are initialized with level `FATAL` ([#852](https://github.com/getsentry/sentry-native/pull/852)) +- Fix MSVC compiler error with on non-Unicode systems ([#846](https://github.com/getsentry/sentry-native/pull/846), [crashpad#85](https://github.com/getsentry/crashpad/pull/85)) **Features**: - crashpad_handler: log `body` if minidump endpoint response is not `OK` ([#851](https://github.com/getsentry/sentry-native/pull/851), [crashpad#87](https://github.com/getsentry/crashpad/pull/87)) +**Thank you**: + +Features, fixes and improvements in this release have been contributed by: + +- [@xyz1001](https://github.com/xyz1001) + ## 0.6.3 **Features**: @@ -23,10 +30,6 @@ - Updated Breakpad backend to 2023-05-03. ([#836](https://github.com/getsentry/sentry-native/pull/836), [breakpad#35](https://github.com/getsentry/breakpad/pull/35)) - Updated Crashpad backend to 2023-05-03. ([#837](https://github.com/getsentry/sentry-native/pull/837), [crashpad#82](https://github.com/getsentry/crashpad/pull/82)) -**Fixes**: - -- Fix MSVC compiler error with on non-Unicode systems ([#846](https://github.com/getsentry/sentry-native/pull/846), [crashpad#85](https://github.com/getsentry/crashpad/pull/85)) - ## 0.6.2 **Features**: