Skip to content

Calling process_exec too many times in the same running process will error out with EMFILE #6294

@neraid-live

Description

@neraid-live

Context

Odin: dev-2026-02:7b18a08d5
OS: Arch Linux, Linux 6.18.9-arch1-2
CPU: AMD Ryzen 5 8600G w/ Radeon 760M Graphics
RAM: 31167 MiB
Backend: LLVM 21.1.6

Expected Behavior

process_exec should always properly close process handles to avoid EMFILE

Current Behavior

process_exec doesn't clean up process/file handles

Failure Information (for bugs)

Consider the scenario:
You have a program with an infinitely running for loop which will take the stdout of a process_exec call and do parsing on that output and print it to the console every 5s. After a few iterations, process_exec starts erroring out with EMFILE due to the process handles not being properly cleaned up.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. call process_exec a bunch of times

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions