Skip to content

Make proc_exit terminate the Linux process rather than only the calling thread #565

Closed

Description

@LunaStev

std::process::core::proc_exit delegates to the Linux provider's exit, which invokes raw syscall 60 on amd64 and 93 on arm64/riscv64. Those are thread-exit syscalls. In a process containing other native threads, calling proc_exit can leave those threads running instead of terminating the process. LoongArch64 inherits the generic provider.

This is distinct from adding a Wave thread scheduler: Wave code can already be called from a native multithreaded host. The process-level API needs deliberate process-level termination semantics.

Code evidence:

Acceptance:

  • Route process termination through the appropriate raw exit_group syscall for each supported Linux architecture.
  • If a thread-only termination primitive is retained, keep it distinct from proc_exit.
  • Add an isolated subprocess fixture with another live native thread and verify process exit/status without a lingering worker.
  • Retain single-threaded exit, child exec-failure behavior and the no-libc implementation.

Reference: Linux raw exit versus process termination. This does not require introducing async main or a new thread API.

Audit status: static source inspection against canonical master ea74c2dafc31da876e5561f2d176ba719f5a0458 on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.

Activity

  1. added
    bug
    help wanted
    os-specific bug
    on Sep 10, 2026
  2. added a commit that references this issue on Sep 16, 2026
    451cc7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wantedos-specific bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions