From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82059 invoked by alias); 13 Jan 2017 08:42:04 -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 81909 invoked by uid 89); 13 Jan 2017 08:42:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-101.6 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=iron, Hx-languages-length:1978, enright, Enright X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 08:41:52 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id 9C1AC721E2822 for ; Fri, 13 Jan 2017 09:41:49 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 144835E027F for ; Fri, 13 Jan 2017 09:41:48 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id F0364A8055A; Fri, 13 Jan 2017 09:41:47 +0100 (CET) Date: Fri, 13 Jan 2017 08:42:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Hangs on connect to UNIX socket being listened on in the same process (was: Cygwin hanging in pselect) Message-ID: <20170113084147.GF23119@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20170109141306.GB843@calimero.vinschen.de> <20170109171635.GB26337@calimero.vinschen.de> <20170112221323.GE23119@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4VrXvz3cwkc87Wze" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2017-01/txt/msg00137.txt.bz2 --4VrXvz3cwkc87Wze Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1918 On Jan 12 16:54, Michael Enright wrote: > On Thu, Jan 12, 2017 at 2:13 PM, Corinna Vinschen > wrote: > > Step 3: > > > > If we did it really intelligent, maybe we finally also have a method > > to implement descriptor passing. Finally. After all these years. > > > > And maybe, we should not actually use the socket itself to exchange > > the information but rather create some kind of side-channle for that. > > > > Especially in terms of step 3, I'm mulling over this for years now > > and always something else got in the way and had to be done first. > > > > >=20 > I made a program that needed to pass windows HANDLEs between processes > and so that receiving process could access the shared memory > represented by the HANDLEs. I was emulating facilities many programs > implement using send_msg, but I was using Windows (named?) pipes. It > felt a lot like what you need for send_msg, and it required newer > Windows APIs. So by doing the crazy thing of completely rewriting your > AF_UNIX sockets you could "easily" add descriptor passing. /me spilled her coffee reading the word "easily". I'm aware that named pipes have a facility to switch the user context, which helps to handle the descriptor duplication. I thought about this, too, but it's really a lot of work since it doesn't fit well into the current fhandler layout. I'm not generally opposed to split off AF_LOCAL sockets from the generic socket fhandler and rewrite it completely, but it took a long time getting sockets to behave mostly POSIXy and I fear we introduce a completely new set of POSIX incompatibilies which take another long time to iron out. That's why I suggested to use an additional named pipe per AF_LOCAL socket as a side-channel. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --4VrXvz3cwkc87Wze Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYeJLLAAoJEPU2Bp2uRE+gcxUP/jJbAF+xa3ISCMP7zvJomS4f 4ku6mZzSyo1vWG2v1KGHSdyB+rWIHPhHJB0R5r2ibDrZdYmthYgG4goAG2/vQE4m j/w/Ls0EABvAN4yTyPAAdXNszWqActyAMf6O8OsZ2P0TmMeQ/DPYBvVNzkVdzjQM ZT+eRaZScLu1pSiouZl/hojzFFrJqJuon13rdlBdWXzjtJK8jRX7O9CM+6P3LgDm Fs83/U5o3vlYOnOAZ6SbF+z7Oez/rIIjI+RI27aGc1Rw93HZs2A5KsF6piSqLHhx f1aOJkbJrO+q/KPqDf5niIEOR5YQbMxuWocK59AjmeOSO9fQhAqUYln4DDE3SmXr nHi9vBJE8O2v0SlwhmtjZwWT5gsyku40rWpGan6k6bVLhilJhS37HXLFkCWUfcTm OgEB13IJhL4iXVq6kG1k/qU3AApuLD1axd5hBFM2CMMCdOuoPFHNagkGiFJ4SVsO MwH6j0PtMmD2QVlxxaY5zqD8XILMXfOhYeoeWSx7AG60hXB+tynrNsuQlHtnXpNG IvqSO1zugr4LNPx5sLGClXZrdi3T7lBKkMRtCrKpHZUL7tVpFceHXQekgT4WcvNQ tAl7XP6LUFGqdbpEsreD13eRsQRTTtA1YOg0AWJlgYurnSVzocGWIlHnlIhO39Wm YuTVdtTcto+cWH2uZwVK =JNWS -----END PGP SIGNATURE----- --4VrXvz3cwkc87Wze--