public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Norton Allen <allen@huarp.harvard.edu>
To: Ken Brown <kbrown@cornell.edu>, cygwin <cygwin@cygwin.com>
Subject: Re: Unix Domain Socket Limitation?
Date: Mon, 30 Nov 2020 21:22:56 -0500	[thread overview]
Message-ID: <fb523694-7775-1d7a-db55-27ccbd6d157c@huarp.harvard.edu> (raw)
In-Reply-To: <85c9c70f-c016-0f88-099e-5c772adbc648@huarp.harvard.edu>

On 11/30/2020 9:14 PM, Norton Allen wrote:
> On 11/30/2020 6:19 PM, Ken Brown wrote:
>> On 11/30/2020 1:26 PM, Norton Allen wrote:
>>> On 11/30/2020 1:14 PM, Ken Brown wrote:
>>>> I can reproduce the hang, and it happens if I use the new AF_UNIX 
>>>> code also. But what I'm seeing (at least with the new code) isn't 
>>>> exactly what you describe.
>>>>
>>>> When the server's first select call returns, accept succeeds. The 
>>>> server then calls select a second time, and that call doesn't 
>>>> return. I haven't checked yet to see what's going on in the client, 
>>>> and I may not get to that for a while.
>>>>
>>> That's good news, and seems to be consistent with my theory that it 
>>> is some sort of race condition that might be particularly sensitive 
>>> to system-specific timing. I am compiling cygwin1.dll now.
>>
>> Hi Norton,
>>
>> I think there's a mistake in your test program.  Shouldn't 
>> client_pselect() be waiting for the socket to be write-ready rather 
>> than read-ready?  Here's a quote from the Posix page for 'connect':
>>
>> If the connection cannot be established immediately and O_NONBLOCK is 
>> set for the file descriptor for the socket, connect() shall fail and 
>> set errno to [EINPROGRESS], but the connection request shall not be 
>> aborted, and the connection shall be established asynchronously....
>>
>> When the connection has been established asynchronously, pselect(), 
>> select(), and poll() shall indicate that the file descriptor for the 
>> socket is ready for writing.
>>
> Yes, you are correct. In fact I had already fixed that bug on another 
> branch, then forgot to update it on this one. I also noticed another 
> bug in calculating width. Now I am not getting the blocking behavior 
> but instead getting the wrong bits set in select(). I think I'd better 
> pick this up in the morning when I am thinking straight!

Yeah, so now the example no longer blocks for me. Unfortunately these 
bugs are not present in my application, so I will need to keep working 
on this.



  reply	other threads:[~2020-12-01  2:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 21:47 Norton Allen
2020-11-25 22:27 ` Ken Brown
     [not found]   ` <4260ad1b-4ab2-fa36-fd0e-7c9644560114@huarp.harvard.edu>
2020-11-26 17:13     ` Ken Brown
2020-11-30 17:19       ` Norton Allen
2020-11-30 18:14         ` Ken Brown
2020-11-30 18:26           ` Norton Allen
2020-11-30 23:19             ` Ken Brown
2020-12-01  2:14               ` Norton Allen
2020-12-01  2:22                 ` Norton Allen [this message]
2020-12-02 17:30                   ` Norton Allen
2020-12-04  1:11                     ` Ken Brown
2020-12-04 13:51                       ` Norton Allen
2020-12-05 23:52                         ` Ken Brown
2020-12-06 17:17                           ` Norton Allen
2020-12-06 22:32                             ` Ken Brown

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=fb523694-7775-1d7a-db55-27ccbd6d157c@huarp.harvard.edu \
    --to=allen@huarp.harvard.edu \
    --cc=cygwin@cygwin.com \
    --cc=kbrown@cornell.edu \
    /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).