python fails asyncio tests (py 3.7 & 3.8)

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Dec 3 09:28:46 GMT 2020


On Dec  2 22:57, Mark Geisert wrote:
> [replying to myself.. sorry..]
> 
> On Wed, 2 Dec 2020, Mark Geisert wrote:
> 
> > Hi Corinna,
> > 
> > On Wed, 2 Dec 2020, Corinna Vinschen wrote:
> > [...]
> > > 
> > > This is apparently an old problem in the still current AF_LOCAL
> > > implementation.  Christian Franke encountered it when porting postfix:
> > > 
> > > https://sourceware.org/legacy-ml/cygwin/2014-08/msg00420.html
> > > 
> > > The problem is the security handshake between listening/accepting socket
> > > and connecting socket.  The connecting socket send its half of the
> > > handshake and waits for accept on the other side to return the other
> > > half.  However, if the listening side doesn't accept right away, the
> > > connecting side hangs.
> > > 
> > > The workaround right now is to call
> > > 
> > >  int peercred_off = 1;
> > >  fd = socket (AF_LOCAL, SOCK_STREAM, 0);
> > >  setsockopt(fd, SOL_SOCKET, SO_PEERCRED, &peercred_off, sizeof
> > > peercred_off);
> > > 
> > > This disables the security handshake.
> > 
> > I see.  For this problem report should the setsockopt() workaround be
> > applied to Python (yikes!) or can it be done for all apps at once in
> > fhandler_socket_local::socket()?  I might be able to look into the
> > standing issue with the security handshake later on, if (my) time
> > permits. I appreciate the history/explanation on this.
> > Thanks & Regards,
> > 
> > ..mark
> 
> Putting the workaround in fhandler_socket_local::socket() compiles fine and
> the OP's Python testing issue seems fixed.  OTOH XWin and X apps exit soon
> after starting so that's no bueno.
> 
> It looks like the individual Python tests that exhibit the problem are going
> to need patching.  Does that sound about right?

In theory it's just a testcase and we have a known workaround for
that.  The testcase can be marked as XFAIL for Cygwin or get the
extra setsockopt() call for Cygwin, both is fine.


Corinna


More information about the Cygwin-developers mailing list