public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin-developers@cygwin.com
Subject: Re: python fails asyncio tests (py 3.7 & 3.8)
Date: Mon, 1 Feb 2021 11:17:00 +0100	[thread overview]
Message-ID: <f0c512bd-ef67-5d9e-387e-c273fd377218@gmail.com> (raw)
In-Reply-To: <20201203092846.GZ303847@calimero.vinschen.de>

On 03.12.2020 10:28, Corinna Vinschen via Cygwin-developers wrote:
> 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
> 

the latest python packages to solve the asyncio issue are patched
to bypass  Cygwin "socketpair" and use an internal alternative
Python3 version for system without that functionality.

But of course proper working socket functions will be appreciated.

https://sourceware.org/pipermail/cygwin/2021-January/247610.html

      a, b = _socket.socketpair(family, type, proto)
SystemError: <built-in function socketpair> returned NULL without 
setting an error

https://sourceware.org/pipermail/cygwin/2021-January/247679.html

Regards
Marco

      reply	other threads:[~2021-02-01 10:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02  9:01 Mark Geisert
2020-12-02 13:38 ` Corinna Vinschen
2020-12-03  2:09   ` Mark Geisert
2020-12-03  6:57     ` Mark Geisert
2020-12-03  9:28       ` Corinna Vinschen
2021-02-01 10:17         ` Marco Atzeri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0c512bd-ef67-5d9e-387e-c273fd377218@gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).