From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from jc-bell.com (jc-bell.com [199.233.228.118]) by sourceware.org (Postfix) with ESMTPS id F25B53857C55 for ; Sun, 22 Nov 2020 00:13:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F25B53857C55 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=JC-Bell.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=Jim@JC-Bell.com Received: from [10.0.0.2] (c-73-50-14-119.hsd1.il.comcast.net [73.50.14.119]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by jc-bell.com (Postfix) with ESMTPSA id 29C4B15EC20 for ; Sat, 21 Nov 2020 18:13:16 -0600 (CST) Subject: Re: python fails asyncio tests (py 3.7 & 3.8) To: cygwin@cygwin.com References: From: Jim Bell Organization: J. C. Bell & Associates, Inc. Message-ID: <5233b4bb-8e9e-b6bd-0a56-c6ce5aa43f42@JC-Bell.com> Date: Sat, 21 Nov 2020 18:13:14 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2020 00:13:20 -0000 On 2020-11-21 5:59 AM, Jim Bell wrote: > The standard python asyncio tests hang. > >         cd /usr/lib/python3.8/test > >         python3.8 test_asyncore.py -v > > [...] Using strace, stripping down this very repeatable test, and grabbing the source-code snapshot, it looks like winsup/cygwin/select.cc socket_cleanup() is waiting forever for the thread to go away. strace:   121 6732185 [main] python3.8 13329 select_stuff::cleanup: calling cleanup rout ines   178 6732363 [main] python3.8 13329 socket_cleanup: si 0x800290E10 si->thread 0 x18023E758 - But I don't see the select_printf("returning")  at select.cc:1808, so the si->thread->detach() call seems to be blocked forever.  I don't see that we make it here either:     select.cc:1685  select_printf ("leaving thread_socket"); I see a bool stop_thread field in select_info, inherited by select_socket_info (select.h), used by other mechanisms. Seems that could be set by socket_cleanup() and used by thread_socket() to break out of its event loops (select.cc lines 1660  and 1667) https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/select.cc;hb=HEAD#l1796