[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-devel
Subject:    Re: [Sbcl-devel] [Patch][Windows] WAIT-UNTIL-FD-USABLE fails to detect EOF on windows socket
From:       Stas Boukarev <stassats () gmail ! com>
Date:       2020-08-04 18:38:00
Message-ID: CAF63=11y+FKsupByeHEoaVwyxg6JmCiyaQajvW7JEuL8+PGShw () mail ! gmail ! com
[Download RAW message or body]

Applied.

On Mon, Aug 3, 2020 at 11:07 PM Matthew Stickney <mtstickney@gmail.com> wrote:
>
> After some helpful and much-appreciated prodding by Fábio Vieira de
> Almeida at SISCOG, I've finally got back around to this again. A quick
> refresher since this is an old issue: on Windows, waiting on a socket
> fd with SB-SYS:WAIT-UNTIL-FD-USABLE, when the remote end has been
> closed, will hang indefinitely. This is an issue with CL+SSL[1], for
> example.
>
> The attached patch does three things:
>
> 1. Fixes SB-WIN32:HANDLE-LISTEN to detect EOF for sockets by using
> select() instead of WSAIoctl, which fixes the hang with
> SB-SYS:WAIT-UNTIL-FD-USABLE.
>
> 2. Fixes a similar problem where HANDLE-LISTEN wasn't checking for EOF
> when listening to named pipes (but see below).
>
> 3. Adds unit tests for both of those cases and the bug with LISTEN
> that showed up in an early version of this patch.
>
> The change to named-pipe listening is functionally a no-op: the
> previous code failed to detect EOF on the pipe and fell through into
> the socket listening code, which returned a not-a-socket error. Errors
> detected in HANDLE-LISTEN are treated as "input available", so the
> outcome is the same as having caught EOF correctly to begin with.
> However, in this patch, EOF is checked explicitly for named pipes, and
> no longer relies on the socket code to do the right thing for both
> sockets and pipes.
>
> Fábio has been helping out with testing on this -- I believe they are
> running this patch in production, but at a minimum he's confirmed this
> fixes the WAIT-UNTIL-FD-USABLE hang exposed in CL+SSL.
>
> -Matt Stickney
>
> [1] https://github.com/cl-plus-ssl/cl-plus-ssl/issues/66
> _______________________________________________
> Sbcl-devel mailing list
> Sbcl-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sbcl-devel


_______________________________________________
Sbcl-devel mailing list
Sbcl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic