Skip to content

[ISSUE] Phase 1: Complete glibc Multithreading, Futex Operations, and Advanced Signal Syscalls #279

Todo
0 of 2 issues completed

Description

@marcobuschini

Parent Epic

#265

Blocked By / Dependencies

None (builds directly on #263 and #264 / PR #278 baseline, which already provides clone(CLONE_THREAD), SharedProcessState, exit/exit_group, gettid, tkill/tgkill, set_tid_address, set_robust_list, and basic futex(FUTEX_WAIT/WAKE)).

Problem Statement & Context

While #264 established userspace threads and basic FUTEX_WAIT/FUTEX_WAKE, full glibc NPTL and multi-threaded Linux applications rely on additional futex primitives (FUTEX_REQUEUE, FUTEX_CMP_REQUEUE, FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET), exit-time robust-list cleanup (get_robust_list), modern thread creation (clone3), restartable sequences (rseq), and POSIX signal extensions (sigaltstack, rt_sigsuspend, rt_sigtimedwait, rt_sigpending, rt_sigqueueinfo).

Scope & Technical Touchpoints

In Scope

  • Extended futex operations (REQUEUE, CMP_REQUEUE, WAIT_BITSET, WAKE_BITSET), get_robust_list (100) + exit-time robust mutex wakeups, rseq (293), and clone3 (435)
  • Alternate signal stacks (sigaltstack 132) and synchronous/queued signal syscalls (rt_sigsuspend 133, rt_sigpending 136, rt_sigtimedwait 137, rt_sigqueueinfo 138)

Technical Touchpoints

  • kernel/uapi/sys.hpp, kernel/uapi/signal.hpp
  • kernel/sync/Futex.hpp, kernel/sync/Futex.cpp
  • kernel/process/Process.hpp, kernel/process/Process.cpp, kernel/process/Signal.hpp, kernel/process/Signal.cpp
  • kernel/syscalls/ProcessSyscalls.cpp, kernel/syscalls/SignalSyscalls.cpp, kernel/syscalls/SyscallInternal.hpp, kernel/syscalls/SyscallDispatcher.cpp
  • tests/host/, kernel/shell/tests/

Out of Scope

  • signalfd4 / epoll_pwait2 (Phase 2)
  • waitid / prctl / scheduler affinity & priority syscalls (Phase 4)
  • ptrace (Phase 6)

Split Verdict: SPLIT

Rationale: Futex/robust-list/clone3 changes live in kernel/sync/ and kernel/process/Process.*, whereas alternate signal stacks and rt_sig* syscalls modify signal frame delivery in kernel/process/Signal.* and kernel/syscalls/SignalSyscalls.cpp. Splitting into 2 atomic subissues isolates failure modes cleanly.

Subissues

Acceptance Criteria

  • All Phase 1 syscalls conform to Linux AArch64 (asm-generic/unistd.h) LP64 ABI with static_assert-checked UAPI structs
  • Freestanding C++20 invariants preserved (-fno-exceptions -fno-rtti, final classes, private m_* members, RAII guards)
  • Host Snitch ASan/UBSan tests in tests/host/ and QEMU shell tests pass with zero PFA/heap leaks
  • make format && make clean-tests && make -j"$(nproc)" all && make -j"$(nproc)" quality passes with zero warnings

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions