Skip to content

Race condition in makeConnectedServerPipe causes win32PipeListener.Close() deadlock #85

@djsweet

Description

@djsweet

On line 273 in pipe.go, makeConnectedServerPipe signals to the connectPipe goroutine that the listener has been closed by closing the underlying pipe it is trying to connect. However, if the connectPipe call succeeds before the call to p.Close(), then err may also be one of cERROR_PIPE_CONNECTED or cERROR_NO_DATA. This causes makeConnectedServerPipe to effectively swallow the control signal sent over l.closeCh, preventing listenerRoutine from accepting it, causing win32PipeListener.Close() to deadlock without ever closing the listener.

I have been able to reproduce this behavior while developing #84, but only by running go test in a loop until the deadlock occurs.

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