From 9be6fe583b880fbec2aabba4dace46d1e8e36c49 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 15 Aug 2025 14:34:33 +0200 Subject: [PATCH 1/7] fix: correctly apply dynamic mutex initialization in unit-tests (#1337) --- tests/unit/test_concurrency.c | 8 ++++++++ tests/unit/test_sync.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/unit/test_concurrency.c b/tests/unit/test_concurrency.c index 18d3fe3ad..e8c7e5926 100644 --- a/tests/unit/test_concurrency.c +++ b/tests/unit/test_concurrency.c @@ -3,11 +3,17 @@ #include +#ifdef SENTRY__MUTEX_INIT_DYN +SENTRY__MUTEX_INIT_DYN(g_test_check_mutex) +#else static sentry_mutex_t g_test_check_mutex = SENTRY__MUTEX_INIT; +#endif static void send_envelope_test_concurrent(sentry_envelope_t *envelope, void *data) { + SENTRY__MUTEX_INIT_DYN_ONCE(g_test_check_mutex); + sentry__atomic_fetch_and_add((long *)data, 1); sentry_value_t event = sentry_envelope_get_event(envelope); @@ -27,6 +33,8 @@ send_envelope_test_concurrent(sentry_envelope_t *envelope, void *data) static void init_framework(long *called) { + SENTRY__MUTEX_INIT_DYN_ONCE(g_test_check_mutex); + sentry__mutex_lock(&g_test_check_mutex); SENTRY_TEST_OPTIONS_NEW(options); sentry__mutex_unlock(&g_test_check_mutex); diff --git a/tests/unit/test_sync.c b/tests/unit/test_sync.c index 33f365d90..795595554 100644 --- a/tests/unit/test_sync.c +++ b/tests/unit/test_sync.c @@ -59,11 +59,17 @@ sleep_task(void *UNUSED(data), void *UNUSED(state)) } static sentry_cond_t trailing_task_done; +#ifdef SENTRY__MUTEX_INIT_DYN +SENTRY__MUTEX_INIT_DYN(executed_lock) +#else static sentry_mutex_t executed_lock = SENTRY__MUTEX_INIT; +#endif static void trailing_task(void *data, void *UNUSED(state)) { + SENTRY__MUTEX_INIT_DYN_ONCE(executed_lock); + sentry__mutex_lock(&executed_lock); bool *executed = (bool *)data; *executed = true; @@ -93,6 +99,8 @@ collect(void *task, void *data) SENTRY_TEST(task_queue) { + SENTRY__MUTEX_INIT_DYN_ONCE(executed_lock); + sentry__cond_init(&trailing_task_done); sentry_bgworker_t *bgw = sentry__bgworker_new(NULL, NULL); TEST_ASSERT(!!bgw); From 7f4ceb11f31bba8639d289162d138b301070a413 Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Sun, 17 Aug 2025 17:05:01 +0200 Subject: [PATCH 2/7] chore:Fix typo in readme (#1341) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 629a6c23e..a0e88b734 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,9 @@ LLVM + Clang are mandatory here : they are required to generate .pdb files, used For your application to generate the appropriate .pdb output, you need to activate CodeView file format generation on your application target. To do so, update your own CMakeLists.txt with something like `target_compile_options(${yourApplicationTarget} PRIVATE -gcodeview)`. -If you use a MSYS2 environement to compile with MinGW, make sure to : +If you use a MSYS2 environment to compile with MinGW, make sure to : -- Create an environement variable `MINGW_ROOT` (ex : `C:/msys64/mingw64`) +- Create an environment variable `MINGW_ROOT` (ex : `C:/msys64/mingw64`) - Run from `mingw64.exe` : `pacman -S --needed - < ./toolchains/msys2-mingw64-pkglist.txt` - Build as : From 70f2bd8c4d05b300f75d9a71bc375a3d8b003603 Mon Sep 17 00:00:00 2001 From: "R. Savchenko" Date: Fri, 29 Aug 2025 09:51:19 +0200 Subject: [PATCH 3/7] chore: fix `sentry_close` return value documentation (#1344) * sentry_close: fix return value documentation * sentry_shutdown: fix return value documentation --- include/sentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sentry.h b/include/sentry.h index fe814a3af..a25078eaf 100644 --- a/include/sentry.h +++ b/include/sentry.h @@ -1551,7 +1551,7 @@ SENTRY_API int sentry_flush(uint64_t timeout); /** * Shuts down the sentry client and forces transports to flush out. * - * Returns 0 on success. + * Returns the number of envelopes that have been dumped. * * Note that this does not uninstall any crash handler installed by our * backends, which will still process crashes after `sentry_close()`, except @@ -1566,7 +1566,7 @@ SENTRY_API int sentry_close(void); /** * Shuts down the sentry client and forces transports to flush out. * - * Returns 0 on success. + * Returns the number of envelopes that have been dumped. */ SENTRY_DEPRECATED("Use `sentry_close` instead") SENTRY_API int sentry_shutdown(void); From 89185217cdbb2a92355922932be7d276e702c40e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 1 Sep 2025 17:36:22 +0200 Subject: [PATCH 4/7] docs: replace legacy sentry_string_free with sentry_free (#1348) * docs: replace legacy sentry_string_free with sentry_free * Update include/sentry.h --- include/sentry.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sentry.h b/include/sentry.h index a25078eaf..acb7016e4 100644 --- a/include/sentry.h +++ b/include/sentry.h @@ -434,7 +434,7 @@ SENTRY_API int sentry_value_is_null(sentry_value_t value); * Serialize a sentry value to JSON. * * The string is freshly allocated and must be freed with - * `sentry_string_free`. + * `sentry_free`. */ SENTRY_API char *sentry_value_to_json(sentry_value_t value); @@ -561,7 +561,7 @@ SENTRY_EXPERIMENTAL_API void sentry_event_add_thread( * Serialize a sentry value to msgpack. * * The string is freshly allocated and must be freed with - * `sentry_string_free`. Since msgpack is not zero terminated + * `sentry_free`. Since msgpack is not zero terminated * the size is written to the `size_out` parameter. */ SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack( @@ -713,7 +713,7 @@ SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( /** * Serializes the envelope. * - * The return value needs to be freed with sentry_string_free(). + * The return value needs to be freed with `sentry_free`. */ SENTRY_API char *sentry_envelope_serialize( const sentry_envelope_t *envelope, size_t *size_out); From 7f84073d0c7494eb26be1a6b3f48271ba2fa8576 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:26:05 +0200 Subject: [PATCH 5/7] docs: improve sentry_attachment_s struct documentation (#1352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: improve sentry_attachment_s struct documentation Clarify that the struct represents a union of two attachment types: - File attachments (path-based) - Buffer attachments (in-memory) Add inline comments to group fields by usage and explain the difference between 'path' (filesystem path) and 'filename' (envelope attachment name). This addresses confusion about why both fields exist and when each is used. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * fix: apply clang-format to attachment struct documentation Fix code formatting to match project style guidelines. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * docs: clarify filename field can be NULL in attachment struct Update inline comment to indicate that filename field can be NULL, in which case the basename of path is used as the attachment name. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --------- Co-authored-by: Claude --- src/sentry_attachment.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/sentry_attachment.h b/src/sentry_attachment.h index cddac9c8b..553a33bed 100644 --- a/src/sentry_attachment.h +++ b/src/sentry_attachment.h @@ -17,15 +17,27 @@ typedef enum { /** * This is a linked list of all the attachments registered via * `sentry_options_add_attachment`. + * + * This struct represents a union of two attachment types: + * - File attachments: `path` is set, `buf`/`buf_len` are NULL/0 + * - Buffer attachments: `buf`/`buf_len` are set, `path` is NULL + * + * The `filename` field is used for both types to specify the attachment + * name in the envelope (defaults to basename of `path` for file attachments). */ struct sentry_attachment_s { - sentry_path_t *path; - sentry_path_t *filename; - char *buf; - size_t buf_len; + // File attachment data (mutually exclusive with buffer data) + sentry_path_t *path; // Full path to file on disk (NULL for buffers) + + // Buffer attachment data (mutually exclusive with file data) + char *buf; // In-memory buffer content (NULL for files) + size_t buf_len; // Buffer size in bytes (0 for files) + + // Common fields for both attachment types + sentry_path_t *filename; // Attachment name in envelope (can be NULL) sentry_attachment_type_t type; char *content_type; - sentry_attachment_t *next; + sentry_attachment_t *next; // Linked list pointer }; /** From 0baec46fb1b9b208c726f3c7d361a5c7532c8b12 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:50:17 +0200 Subject: [PATCH 6/7] chore: prepare changelog for a patch release (#1354) #skip-changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 512c36357..4c575135e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +**Internal:** + +- Correctly apply dynamic mutex initialization in unit-tests (fixes running unit-tests in downstream console SDKs) ([#1337](https://github.com/getsentry/sentry-native/pull/1337)) + ## 0.10.0 **Breaking changes**: From 11f94efc64d55e90aef9456ce01716c846ae1732 Mon Sep 17 00:00:00 2001 From: getsentry-bot Date: Tue, 2 Sep 2025 12:51:24 +0000 Subject: [PATCH 7/7] release: 0.10.1 --- CHANGELOG.md | 2 +- include/sentry.h | 2 +- ndk/gradle.properties | 2 +- tests/assertions.py | 4 ++-- tests/test_integration_http.py | 2 +- tests/win_utils.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c575135e..5097215be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.10.1 **Internal:** diff --git a/include/sentry.h b/include/sentry.h index acb7016e4..9a7ada89e 100644 --- a/include/sentry.h +++ b/include/sentry.h @@ -78,7 +78,7 @@ extern "C" { # define SENTRY_SDK_NAME "sentry.native" # endif #endif -#define SENTRY_SDK_VERSION "0.10.0" +#define SENTRY_SDK_VERSION "0.10.1" #define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION /* marks a function as part of the sentry API */ diff --git a/ndk/gradle.properties b/ndk/gradle.properties index bb0f9043a..5836ef108 100644 --- a/ndk/gradle.properties +++ b/ndk/gradle.properties @@ -7,7 +7,7 @@ org.gradle.parallel=true android.useAndroidX=true # Release information, used for maven publishing -versionName=0.10.0 +versionName=0.10.1 # disable renderscript, it's enabled by default android.defaults.buildfeatures.renderscript=false diff --git a/tests/assertions.py b/tests/assertions.py index aa8f8a26a..83f5e8d96 100644 --- a/tests/assertions.py +++ b/tests/assertions.py @@ -105,9 +105,9 @@ def assert_event_meta( } expected_sdk = { "name": "sentry.native", - "version": "0.10.0", + "version": "0.10.1", "packages": [ - {"name": "github:getsentry/sentry-native", "version": "0.10.0"}, + {"name": "github:getsentry/sentry-native", "version": "0.10.1"}, ], } if is_android: diff --git a/tests/test_integration_http.py b/tests/test_integration_http.py index 30ce91c34..51d846b4f 100644 --- a/tests/test_integration_http.py +++ b/tests/test_integration_http.py @@ -44,7 +44,7 @@ # fmt: off auth_header = ( - "Sentry sentry_key=uiaeosnrtdy, sentry_version=7, sentry_client=sentry.native/0.10.0" + "Sentry sentry_key=uiaeosnrtdy, sentry_version=7, sentry_client=sentry.native/0.10.1" ) # fmt: on diff --git a/tests/win_utils.py b/tests/win_utils.py index c6715a848..331dba54f 100644 --- a/tests/win_utils.py +++ b/tests/win_utils.py @@ -1,7 +1,7 @@ import pathlib import win32api -sentry_version = "0.10.0" +sentry_version = "0.10.1" def check_binary_version(binary_path: pathlib.Path):