Skip to content

Crashpad crash collection is not thread-safe #931

@stima

Description

@stima

Description

During sentry__crashpad_handler crash_event is not synchronized properly.

When does the problem happen

  • During build
  • During run-time
  • When capturing a hard crash

Environment

  • OS: Unrelated
  • Compiler: Unrelated
  • CMake version and config: Unrelated

Steps To Reproduce

For example sentry_set_tag that executed from one thread and sentry__crashpad_handler that capturing crash in another thread, may lead to a race condition while accessing crash_event variable.

sentry_set_tag call would lead to sentry__scope_flush_unlock call, that would lead to options->backend->flush_scope_func that would lead to crashpad_backend_flush_scope and access to a crash_event that may be freed by that line https://github.com/getsentry/sentry-native/blob/164da7919172b0df9c7b75efbc36e6e897124415/src/backends/sentry_backend_crashpad.cpp#L174C4-L174C4.

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions