Skip to content

Conversation

@supervacuus
Copy link
Collaborator

This issue more regularly appeared in the concurrent_init test in recent CI runs and was an actual race.

We update the session if one is active inside a mutable options lock when capturing events. However, the check happened outside the lock. Concurrent session shutdown could mutate the session concurrently.

This PR fixes the race with a recheck inside the lock and a TSAN annotation around the optimistic read outside the lock.

Co-authored-by: Amir Mujacic <amir.mujacic@sentry.io>
@supervacuus supervacuus merged commit f4f7379 into master Sep 17, 2025
37 checks passed
@supervacuus supervacuus deleted the fix/toctou_session_race branch September 17, 2025 14:20
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.

3 participants