Skip to content

Non-accepted sockets and their parent sockets are never disassociated/freed #1781

@stevenengler

Description

@stevenengler

When a listening socket that has child sockets is closed, the listening socket will remain bound to the network interface until all child sockets have closed. If a listening socket has incoming connections which have not yet been accepted, and then that listening socket is closed, it is impossible to close those child sockets as the file handles for those non-accepted sockets have not yet been provided to the user space process*. The non-accepted child sockets will remain open forever, and so will the parent listening socket.

When a listening socket is closed, Shadow should close any pending (TCPCS_PENDING) child sockets, and when any incomplete (TCPCS_INCOMPLETE) child sockets become pending, they should be immediately closed. Once these pending and incomplete sockets are closed, the listening socket can be disassociated from the network interface and freed.

* Shadow currently registers child sockets in the descriptor table before the child socket has been accept()ed by the user space process; see #1780.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions