X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CB54394340C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1620046677;
	bh=fyX+EPRRr0CrtghMp13BSfgprTc04ZyJT1nkK15qmwQ=;
	h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
	 List-Help:List-Subscribe:From:Reply-To:From;
	b=HOgOppc+ydHnVzBwyZHzLK57/ELvnLjpijSpCQG/2GAAAzPKVTBLCVcf5T+5Po9aj
	 LECId+uy2Bj/w1NAKFLfImFzt96p3ViU0/rE14MCJMGz0JHNcobOA/6upyWul9lWBD
	 XAyuDeq+EY3cswYDYTH7DIQxA9jCsuhqGLsz0mvs=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 37F5B393A41A
To: <cygwin@cygwin.com>
Subject: python > 3.5: Issue with unix domain sockets
Thread-Topic: python > 3.5: Issue with unix domain sockets
Thread-Index: AQHXQBhBgI/0QVFcvkOkGGRaQ+5yPw==
Date: Mon, 3 May 2021 12:57:26 +0000
Message-ID: <1620046759893.5340@bmw.de>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
MIME-Version: 1.0
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH,
 DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS,
 RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: "Maximilian.Blenk--- via Cygwin" <cygwin@cygwin.com>
Reply-To: Maximilian.Blenk@bmw.de
Content-Type: text/plain; charset="windows-1252"
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 143Cw1x8021012

Hello everyone,

I noticed that latest Cygwin release (3.2.0-1) has an issue with python and unix domain sockets, although I’m not a 100% sure about the root cause. My best guess is that something is wrong with the unix domain dockets implementation. I would like to attach the cygcheck.out but it seems to exceed the 180kb limit mentioned on the website (even zipped)

Simple Reproducer:
I tried to get the example shown at https://pymotw.com/3/socket/uds.html working. It works if I execute it with python3.5 (both client and server), but it doesn’t if I use python3.6 or newer (actually tested 3.6 and 3.7 on Windows 10):

Correct Behavior:
Server:
$ python3.5 server.py
starting up on ./uds_socket
waiting for a connection
connection from
received b'This is the mess'
sending data back to the client
received b'age.  It will be'
sending data back to the client
received b' repeated.'
sending data back to the client
received b''
no data from
waiting for a connection
…

Client:
$ python3.5 client.py
connecting to ./uds_socket
sending b'This is the message.  It will be repeated.'
received b'This is the mess'
received b'age.  It will be'
received b' repeated.'
closing socket

Incorrect Behavior:
Server:
$ python3.7 server.py
starting up on ./uds_socket
waiting for a connection
Traceback (most recent call last):
  File "server.py", line 27, in <module>
    connection, client_address = sock.accept()
  File "/usr/lib/python3.7/socket.py", line 214, in accept
    sock = socket(self.family, self.type, self.proto, fileno=fd)
  File "/usr/lib/python3.7/socket.py", line 151, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
SystemError: <slot wrapper '__init__' of '_socket.socket' objects> returned NULL without setting an error

Client:
$ python3.7 client.py
connecting to ./uds_socket
sending b'This is the message.  It will be repeated.'
closing socket
Traceback (most recent call last):
  File "client.py", line 27, in <module>
    data = sock.recv(16)
ConnectionResetError: [Errno 104] Connection reset by peer


Am I missing something? 

BR Max

--

BMW Car IT GmbH
Maximilian Blenk
Security Engineer

Lise-Meitner-Str. 14
89081 Ulm

Web: http://www.bmw-carit.de
------------------------------------------------------
BMW Car IT GmbH
Geschäftsführer: Kai-Uwe Balszuweit und Michael Böttrich
Sitz und Registergericht: München HRB 134810
------------------------------------------------------

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

