Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork201
PermalinkChoose a base ref {{ refName }}default Choose a head ref {{ refName }}default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also orlearn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also.Learn more about diff comparisons here.
base repository:getsentry/sentry-native
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
Uh oh!
There was an error while loading.Please reload this page.
base:0.11.1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}defaultLoading
...
head repository:getsentry/sentry-native
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
Uh oh!
There was an error while loading.Please reload this page.
compare:0.11.2
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}defaultLoading
- 4commits
- 13files changed
- 6contributors
Commits on Oct 1, 2025
test: Fix test failures when session tracking is enabled (#1393)
* fix(logs): Fix test failures when session tracking is enabledThis commit fixes 3 test failures in test_logs.c that occur whenauto-session tracking is enabled (the default):- basic_logging_functionality- formatted_log_messages- logs_disabled_by_defaultRoot causes and fixes:1. validate_logs_envelope counted all envelopes but only validated logs - Session envelopes from sentry_close() were triggering assertions - Fixed by filtering: only count/validate log envelopes, skip others2. formatted_log_messages didn't wait for batching thread to start - Added sleep_ms(20) after sentry_init() to match other tests3. batching_stop flag wasn't reset between sentry_init() calls - Once set to 1 during shutdown, subsequent startups would fail - Fixed by resetting to 0 in sentry__logs_startup()These issues were discovered in console SDK testing where sessiontracking is enabled by default and tests run sequentially in a singleprocess.🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>* fix(logs): Eliminate thread startup race with enum state machineThis commit eliminates the thread startup race condition by:1. Replacing batching_stop with enum-based thread_state - SENTRY_LOGS_THREAD_STOPPED (0): Not running - SENTRY_LOGS_THREAD_RUNNING (1): Thread active and processing logs - Improves code clarity and makes thread lifecycle explicit2. Thread signals RUNNING state after initialization - Batching thread sets state to RUNNING after mutex setup - Provides deterministic indication that thread is ready3. Adding test-only helper: sentry__logs_wait_for_thread_startup() - Polls thread_state until RUNNING (max 1 second) - Zero production overhead (only compiled with SENTRY_UNITTEST) - Tests explicitly wait for thread readiness instead of arbitrary sleeps4. Updating shutdown to use atomic state transition - Atomically transitions from RUNNING to STOPPED - Detects double shutdown or never-started cases - Returns early if thread wasn't runningBenefits:- Eliminates race where logs could be enqueued before thread starts- Tests are deterministic (no arbitrary timing assumptions)- Code is clearer with explicit state names- No production overhead (test helper is ifdef'd out)The one remaining sleep in basic_logging_functionality test is intentional- it tests batch timing behavior (wait for buffer flush).🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>* fix(logs): Fix thread lifecycle race condition causing memory leaksThis commit fixes a race condition in the logs batching thread lifecyclethat caused valgrind to report 336 byte memory leaks in CI tests.## ProblemWhen `sentry__logs_shutdown()` ran before the batching thread transitionedfrom initial state to RUNNING, the two-state model couldn't distinguishbetween "never started" and "starting but not yet running", causingshutdown to skip joining the thread.## Solution1. Added three-state lifecycle enum: - STOPPED (0): Thread never started or shut down - STARTING (1): Thread spawned but not yet initialized - RUNNING (2): Thread active and processing logs2. Added `sentry__atomic_compare_swap()` primitive for atomic state verification (cross-platform: Windows InterlockedCompareExchange, POSIX __atomic_compare_exchange_n)3. Startup sets state to STARTING before spawning thread4. Thread uses CAS to verify STARTING → RUNNING transition - If CAS fails (shutdown already set to STOPPED), exits cleanly - Guarantees thread only runs if it successfully transitioned5. Shutdown always joins thread if old state != STOPPED## Benefits- Eliminates race condition where shutdown could miss a spawned thread- Thread explicitly verifies state transition with CAS- No memory leaks in any shutdown scenario- All 212 unit tests pass- All log integration tests passFixes test failures:- test_before_send_log- test_before_send_log_discard🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>* docs(logs): Address code review comments with clarifying documentationAddresses bot review feedback by adding documentation without changing behavior:1. **CAS memory ordering**: Added comment explaining sequential consistency usage for thread state transitions and why it's appropriate for synchronization2. **Condition variable cleanup**: Added note explaining that static storage condition variables don't require explicit cleanup on POSIX and Windows3. **CAS function documentation**: Enhanced docstring to document memory ordering guarantees and note that ABA problem isn't a concern for simple integer state machines4. **Shutdown race handling**: Added comment explaining how the atomic CAS in the thread prevents the race when shutdown occurs during STARTING stateAll changes are documentation/comments only - no behavior changes.🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>* Update src/sentry_logs.cCo-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>---------Co-authored-by: Claude <noreply@anthropic.com>Co-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>
fix(win): make symbolication and modulefinder independent of the syst…
…em ANSI code page. (#1389)* fix(win): make symbolication independent of the system ANSI code page.* allow `NULL` module paths and symbol names.* add an integration test that runs the example from a cyrillic directory and validates the package paths* resolve relative paths + clean up subdir* remove the assertion that a frame must have a function* only assert on the frame_package being a file if it exists......however, no longer assert that a frame_package exists.* isolate package assertions to new test* don't conflate checking any function/package with checking package file validity* also adapt the windows modulefinder to be independent system ACP.The szExePath generated for actual UTF-8 paths was already filled with mojibake :-) so LoadLibrary couldn't find any local modules.This is actually connected to the symbolication:* in the server, if a module was found, the backend would assign packages to frames based on the instruction address and the module address range* if the module couldn't be found, as was the case previously, it had to use the frame package providedSo, now we fixed both and they should overlap.* update the CHANGELOG* explicitly specify `PSAPI_VERSION` because we only want to link kernel32* check string_from_wstr return values* use a heap-allocated 32K buffer for module paths* use a heap-allocated 32K buffer for symbol paths* move allocation into wrapping if* format after webui edit
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:git diff 0.11.1...0.11.2
Uh oh!
There was an error while loading.Please reload this page.