Skip to content

File numbers not closed on some operating systems [rt.cpan.org #130491] #14

@toddr

Description

@toddr

Migrated from rt.cpan.org#130491 (status was 'new')

Requestors:

From [email protected] on 2019-09-11 07:07:08
:

IPC::Run is has a broken test in t/pty.t because IO::Pty objects are not closing all of their file handles when they are destroyed.

https://github.com/toddr/IPC-Run/issues/130

On Fedora 29 and Redhat 8, file handle 4 doesn't reliably close. I've seen it close occasionally so this failure isn't even consistent.

$>perl -MIO::Pty -MIPC::Run::Debug -wE'print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";my $h = IO::Pty->new; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";undef $h; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";'
-e 1  012---------
-e 1  012345------
-e 1  012-4-------

From [email protected] on 2019-09-11 07:08:51
:

See also https://github.com/toddr/IPC-Run/issues/56

From [email protected] on 2019-09-11 07:16:34
:

The file handle seems to get re-used so this isn't a incrementing leak.

$>perl -MIO::Pty -MIPC::Run::Debug -wE'sub loop { print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";my $h = IO::Pty->new; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";undef $h; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n"; } loop() for(1..10);'
-e 1  012---------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------

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