Skip to content

File descriptor leak when spawning new process #26478

Closed
@l0kod

Description

@l0kod

When using an external library and/or FFI bindings, all non-cloexec file descriptors leak to all new processes spawned with Command::spawn().

This was introduced by the I/O reform because the getdtablesize() loop disappeared.

The getdtablesize() loop could be replaced with a walk_dir() through /proc/self/fd when available (cf. #12148 (comment)).

cc #12148
cc #22678
cc #24237
cc rust-lang/rfcs#941

cc @alexcrichton
cc @aturon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions