test: restore dumpable flag so ASan/LSan can run #310

Merged
TapTap merged 1 commits from fix/asan-dumpable into dev 2026-09-22 23:50:55 +02:00
Owner

The new test_device_mknod_failure_is_per_entry drops euid to make the mknodat EPERM path deterministic. A setuid transition clears the process dumpable flag (even after restoring euid), which makes LeakSanitizer's ptrace-based thread suspension fail at exit — the dev-push sanitizers (address) job failed with LeakSanitizer has encountered a fatal error ... does not work under ptrace. Restore the flag with prctl(PR_SET_DUMPABLE, 1) after the test restores euid.

Verified locally: ASan unit tests now exit 0 with leak detection enabled (previously exit 1); UBSan clean.

The new `test_device_mknod_failure_is_per_entry` drops `euid` to make the `mknodat` EPERM path deterministic. A setuid transition clears the process **dumpable** flag (even after restoring euid), which makes LeakSanitizer's ptrace-based thread suspension fail at exit — the dev-push `sanitizers (address)` job failed with `LeakSanitizer has encountered a fatal error ... does not work under ptrace`. Restore the flag with `prctl(PR_SET_DUMPABLE, 1)` after the test restores euid. Verified locally: ASan unit tests now exit 0 with leak detection enabled (previously exit 1); UBSan clean.
TapTap added 1 commit 2026-09-22 23:45:42 +02:00
test: restore dumpable flag after setuid drop so LSan can run under ASan
CI / lint (pull_request) Successful in 1m48s
CI / parity-full (pull_request) Skipped
CI / sanitizers (address) (pull_request) Skipped
CI / sanitizers (undefined) (pull_request) Skipped
CI / fuzz-build (pull_request) Skipped
CI / coverage (pull_request) Skipped
CI / valgrind (pull_request) Skipped
CI / parity-fast (pull_request) Successful in 18s
CI / build-and-test (pull_request) Successful in 55s
a07cc00bb0
TapTap merged commit 6db9827b87 into dev 2026-09-22 23:50:55 +02:00
TapTap deleted branch fix/asan-dumpable 2026-09-22 23:50:55 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#310