Repository navigation
Conversation
Rename the macOS sandbox tests to test_integration_sandbox.py and add Linux tests that simulate sandbox restrictions: a read-only /dev/shm in a user and mount namespace, and a seccomp filter that blocks ptrace. The read-only /dev/shm and semaphore leak tests are expected to fail until the named init semaphore is gone.
sentry_init failed when /dev/shm was not writable, as in containers and sandboxes that restrict /dev/shm: [sentry] WARN failed to create IPC semaphore: Read-only file system [sentry] WARN failed to initialize backend Serialize backend startups with the process-local mutex that macOS and Android already use instead of a named semaphore. This also stops every process from leaving a /dev/shm/sem.sentry-init-<pid> file behind. Ref: getsentry/sentry-dart#3585
With ptrace blocked by seccomp, the minidump had no stack or memory contents, because every read gave up when the attach failed: WARN ptrace(PTRACE_ATTACH) failed for TID <tid>: Operation not permitted WARN Failed to read stack memory from process <pid> at 0x...: Operation not permitted Read with process_vm_readv first, which needs no ptrace attach, and attach only for the PEEKDATA fallback. Ref: getsentry/sentry-dart#3585
jpnurmi
force-pushed
the
jpnurmi/fix/native-sandbox
branch
from
November 26, 2026 12:38
e71d09a to
8b71516
Compare
The Wine job runs on a Linux host but builds Windows binaries, so the Linux sandbox tests ran there and could not find the executable: FileNotFoundError: [Errno 2] No such file or directory: '.../sentry_test_integration' Ref: https://github.com/getsentry/sentry-native/actions/runs/45821617724/job/139946658959
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the native backend to operate in Linux sandboxes that restrict
/dev/shmorptrace. This came up with Flutter, where Linux apps are commonly distributed as strictly confined snaps or Flatpaks.sentry_initfailed with "failed to create IPC semaphore: Read-only file system" when/dev/shmwas not writable. The named semaphore/sentry-init-<pid>only serialized backend startups within the process, so Linux now uses the samesentry_mutex_tas macOS and Android. This also stops every process from leaving a/dev/shm/sem.sentry-init-<pid>file behind:ptraceblocked by seccomp, minidumps had no stack or memory contents, because every read gave up whenPTRACE_ATTACHfailed. The minidump writer now reads withprocess_vm_readvfirst and attaches only for thePTRACE_PEEKDATAfallback.Manually tested with a strictly confined Flutter snap:

https://sentry-sdks.sentry.io/issues/7870817365/
Ref: getsentry/sentry-dart#3585