Skip to content

Socket leak starting with async-std 1.6.4 #891

Closed
@tailhook

Description

@tailhook

This example:

async fn connect() {
    loop {
        match async_std::os::unix::net::UnixStream::connect("./non-existent").await {
            Ok(_) => unreachable!(),
            Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
            Err(e) => panic!("Unexpected error: {}", e),
        }
    }
}

fn main() {
    async_std::task::block_on(connect());
}

Crashes with thread 'main' panicked at 'Unexpected error: Too many open files (os error 24)', examples/test-connect.rs:6:23 while it shouldn't and didn't crash in 1.6.3. The crash means file descriptors are leaking (maybe because of a memory leak, but I didn't investigate further).

This file descriptor leak is still there in 1.6.5 and master as of f09fa42.

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