Skip to content

fix :: build and run tests/fs_fail.c on aarch64 Linux - #193

Merged
HaoZeke merged 3 commits into
developfrom
fix/fs-fail-aarch64
Nov 27, 2026
Merged

HaoZeke merged 3 commits into
developfrom
fix/fs-fail-aarch64

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

tests/fs_fail.c is the ptrace fault injector behind 22 tests. It read x86_64
registers and x86_64 syscall numbers, so gcc failed on the ubuntu-24.04-arm
runner and every one of those tests skipped.

Change

  • Registers come through PTRACE_GETREGSET / PTRACE_SETREGSET with
    NT_PRSTATUS on both architectures, behind REG_* accessors for
    orig_rax/rdi/rsi/rdx/r10/rax (x86_64) and regs[8]/regs[0..3]/regs[0] (aarch64).
  • aarch64 replaces the syscall at entry with getpid through the
    NT_ARM_SYSTEM_CALL regset; x86_64 still writes orig_rax.
  • Syscall numbers come from <sys/syscall.h>. Names that exist on one
    architecture only (open, mkdir, unlink, rename, renameat, dup2)
    are -1 where absent. The generic calls (openat, mkdirat, unlinkat,
    renameat2, dup3, fcntl, flock, fsync, fdatasync, pwritev2) cover aarch64.
  • The syscall-exit side reads arguments from an entry snapshot, because the
    return value overwrites argument 0 on aarch64.
  • tests/support.py: a failed gcc build of fs_fail.c now fails the test
    under EB_STAGED_REBUILD_REQUIRE_TESTS=1 instead of skipping, so a
    regression cannot hide as a skip again.

Evidence

run job tests skipped fs_fail.c skips
45902013207 (develop) zig (ubuntu-24.04-arm) 245 31 22
45911020947 (this branch) zig (ubuntu-24.04-arm, job 140219133322) 245 9 0
45911020947 (this branch) zig (ubuntu-latest, job 140219133066) 245 9 0

22 tests that skipped on arm now run and pass. All jobs of run 45911020947
are green (docs, integration, both wheel builds, five wheel-install jobs).
The 9 remaining skips are unrelated to fs_fail.c.

x86_64 behaviour: the x86_64 suite on a separate x86_64 build host ran 243
tests, OK, with the same fs_fail-using tests running.

Read registers through PTRACE_GETREGSET with NT_PRSTATUS, replace the
syscall at entry through NT_ARM_SYSTEM_CALL on aarch64, resolve syscall
numbers from <sys/syscall.h>, and read arguments from an entry snapshot
because the return value overwrites argument 0 on aarch64. A failed gcc
build now fails the test when EB_STAGED_REBUILD_REQUIRE_TESTS=1.
@HaoZeke
HaoZeke merged commit ae23d49 into develop Nov 27, 2026
25 checks passed
@HaoZeke
HaoZeke deleted the fix/fs-fail-aarch64 branch November 27, 2026 01:37
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.

1 participant