From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101645 invoked by alias); 19 Mar 2019 14:35:23 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 101636 invoked by uid 89); 19 Mar 2019 14:35:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=principal, DOES, expires X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Mar 2019 14:35:21 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE8A6C06644C for ; Tue, 19 Mar 2019 14:35:20 +0000 (UTC) Received: from [10.3.116.65] (ovpn-116-65.phx2.redhat.com [10.3.116.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6613796818 for ; Tue, 19 Mar 2019 14:35:20 +0000 (UTC) Subject: Re: Is async-signal-safety applicable to Cygwin? To: cygwin@cygwin.com References: From: Eric Blake Openpgp: preference=signencrypt Message-ID: <9e5ce156-19c2-8379-6e29-8997c1700d5b@redhat.com> Date: Tue, 19 Mar 2019 14:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7V9SnJ5MdHGL2Mu7723BekRxN10c6iJI5" X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00485.txt.bz2 --7V9SnJ5MdHGL2Mu7723BekRxN10c6iJI5 Content-Type: multipart/mixed; boundary="BIemsF0heglGvAWvjVab8Ih3xZ3pT2odR"; protected-headers="v1" From: Eric Blake To: cygwin@cygwin.com Message-ID: <9e5ce156-19c2-8379-6e29-8997c1700d5b@redhat.com> Subject: Re: Is async-signal-safety applicable to Cygwin? References: In-Reply-To: --BIemsF0heglGvAWvjVab8Ih3xZ3pT2odR Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Content-length: 1213 On 3/19/19 9:28 AM, LRN wrote: > ASS[0] is documented for Linux (and for POSIX) but i'm failing to find any > information on how this applies to Cygwin. I assume, since there are no "= real" > signals on Cygwin, that it's not possible for a signal handler to break t= he > state of some function that happened to be executed when the signal handl= er was > triggered. But i could be wrong. You are wrong. It IS applicable. Cygwin has signals and signal handlers; although Windows may not have POSIX signals as such, it DOES have the ability to interrupt a process mid-function when a timer expires, and cygwin's implementation of signals on top of the semantics that windows provides can indeed result in interrupting the middle of a non-async-safe function. Hence, a signal handler that calls a non-async-safe function at the same time that the signal has interrupted another non-async-safe function is indeed observable on Cygwin and can indeed result in deadlocks (a classic example being the case if you malloc() from a signal handler that interrupted an ongoing malloc() call). --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org --BIemsF0heglGvAWvjVab8Ih3xZ3pT2odR-- --7V9SnJ5MdHGL2Mu7723BekRxN10c6iJI5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 488 -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlyQ/icACgkQp6FrSiUn Q2pSVQgAj2HYJjXqfmgL+BZnT/hpBr0RD1N0Vd+u4mofGq8k1n8aCSa5P8Qyf6Op o8S/kQ5hAo6VCsQuxW+pW4zWvxO10wPzN9b3C410Ao3PPUsStqhAzSDP60T+b2Nx nPDd9BhiQjNNXyYCHWkt2Q3x5gkO2i51jKVIDJ6DAp/L+m0Yn/7zVV5CpY1w+fZ9 nf8ZSlOsezbV9m4EcVR0p4VCLA9qTitfGUNK+zZNbQeZLXcyVCXZ9NgH/ZeTo41w lqr4x/idcokR31EnYJHmwuC89SzXwkgtv8+L4Fy7VWkvl2JqeEE1vGR5oEK89ZO2 Dk64YTCwAXOvfugN7Tg72agogyDe5A== =LeYy -----END PGP SIGNATURE----- --7V9SnJ5MdHGL2Mu7723BekRxN10c6iJI5--