bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22789: 25.1.50; In last master build https connections stop working


From: Alain Schneble
Subject: bug#22789: 25.1.50; In last master build https connections stop working
Date: Mon, 7 Mar 2016 18:20:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alain Schneble <a.s@realize.ch>
>> CC: <larsi@gnus.org>, <j_l_domenech@yahoo.com>, <22789@debbugs.gnu.org>
>> Date: Mon, 7 Mar 2016 09:49:00 +0100
>>
>> - So there /is/ a dependency between these calls.  Unfortunately, I
>>   couldn't see that ioctlsocket returns with WSAEINVAL in the scenarios
>>   I tried.
>
> Yes, I know about this gotcha.  It's just that it never produced any
> problems, and I never was able to see the ioctlsocket call fail with
> WSAEINVAL.

As said, I didn't see WSAEINVAL as well with the current implementation.

>>   Could it be a multi-threading issue then?  Multiple threads
>>   accessing the same socket...
>
> Not sure I follow -- are you trying to explain why ioctlsocket doesn't
> fail as expected, or are you trying to explain some other phenomenon?

Both.  1) I expected it to (sometime) fail but didn't see it.  2) The
arbitrary gnutls_handshake failures I observed seem like the socket's
state is getting corrupted.

Do you agree that WSAEventSelect is called from the reader thread and
the ioctlsocket is called from the main thread?  And AFAIK, these
functions are not thread safe...  So I suspect that we ran into a
multi-threading issue here, which corrupted the socket.  And may have
lead to the above mentioned issues.

>>   I don't see how both threads are synchronized.
>
> The synchronization is between reader_thread and sys_select.  The
> latter runs in the main (a.k.a. "Lisp") thread, the same thread where
> sys_write is called.

This is how I understood it as well...

>>   The patch I sent would synchronize them through the FILE_CONNECT
>>   flag, I think.  Did I miss something?
>
> Well, that's not really "thread synchronization", but see my comments
> and questions there.

Yes, you are right.  I just meant that both threads no longer will call
WSAEventSelect and ioctlsocket at the same time with the proposed patch.
And this is a kind of "synchronization".






reply via email to

[Prev in Thread] Current Thread [Next in Thread]