X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=wkMa12DQVIuTllgvBGCWCQ2T3tngRe8eHhwaOU0ywuorUfhUFh3tu 2hBpFpmIQmB11XAYghuXpSR7spDQSHOey375rbavoMM5uCJs2wsn7izxIfc9BdE2 7zqaTGH86uxQKOvLSY0GM03CdugGqvvHQz5UmUHixnmXfjV4KwMjwg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=7ofFVvozZbis3OSmEo7dykWb4Mw=; b=OMm+kn7gWUqcnwsuf+JMmvYfQ9Zm 1+nxPm/mg8qtQVIFXd8aMuhj1En88OTZwg+3qkmyUkg6yUKtCOe87gSDHLqcuzwt yVB150Ig33wrjBrAoTXXcSC1dRXzZeZsnow6wiCA8YdpT201nO9/mT58Qvrinf1p z2k3QHNugc45Jmw= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Mon, 16 Jun 2014 15:10:53 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: tmux failed and got the message: failed to connect to server: No error Message-ID: <20140616131053.GC23700@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NMuMz9nt05w80d4+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) --NMuMz9nt05w80d4+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 2 11:27, Robert Pendell wrote: > On Mon, Jun 2, 2014 at 4:37 AM, Michael Wild <> wrote: > > Hi Guan-Zhong > > > > The problem is known upstream [1, 2] and I'm also trying to figure out > > which change in the cygwin DLL triggered this issue. I'll post here > > again once I know more. > > > > Michael > > > > [1] http://sourceforge.net/p/tmux/mailman/message/32396655/ > > [2] http://sourceforge.net/p/tmux/mailman/message/32400834/ > > > > On Sat, May 31, 2014 at 5:29 PM, Guan-Zhong Huang wrote: > >> cygwin-1.7.29-2 is ok. > >> After updating to cygwin-1.7.30-1, I can't start tmux. > >> > >> I find it is because when tmux tries to connect to the unix domain > >> socket that tmux server listens and tmux server hasn't started yet, > >> connect() fails but errno is 0, not "Connection Refused (111)". This > >> causes tmux to exit with error. > >> > >> If you want to reproduce this bug. > >> tmux might work at the first time because the unix domain socket is no= t created. > >> But after that, tmux will fail due to incorrect errno. > >> > >> Here's the strace I got: > >> cygwin-1.7.30-1: > >> 96 1063224 [main] tmux 4072 cygwin_connect: -1 =3D connect(5, > >> 0x229780, 24), errno 0 > >> cygwin-1.7.29-2: > >> 92 1054064 [main] tmux 3548 cygwin_connect: -1 =3D connect(5, > >> 0x229780, 24), errno 111 > >> > >> > >> Best regads, > >> Guan-Zhong >=20 > I took a look and ran through some snapshots. I remembered a > discussion last month regarding the propogation of socket errors to > dup'd sockets. It seems the patch (or something commited at the same > time) broke this as on the 4/18 snapshot all works well and it breaks > on the 4/24 snapshot which is the same one that got that last bit > patched. I do not know if the patch was ever tested as the OP of that > thread never responded from what I can tell. Yes, indeed. The patch was supposed to fix the problem with the SOL_SOCKET/SO_ERROR valus not being set when calling select on a duplicated socket. I just gave it a try and it turned out that the Winsock call setsockopt sets the last WSA error code to 0 in case of success (grrr!), which I didn't notice when applying the original patch, sorry. I applied a patch to CVS which should fix the issue by simply calling WSASetLastError after calling setsockopt. The original SO_ERROR testcase still works for me, and a faild connect attempt now returns an ECONNREFUSED as expected. I'll generate a new snapshot later today. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --NMuMz9nt05w80d4+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTnuzdAAoJEPU2Bp2uRE+gpjwP/iU/ZMXOgqQP9S+XVToXv03T ltjE9aNuOUAhL4FjFfz3BSGVdC63VpJueUCFxLBIq/SuATKx2Z3+oLLo3d+G+gBQ kwMO0R2neYpWTIRdUNhQmnmNMxr224KTOB970Xo9K9Ve98NyDJMVmaahNtD7UwR3 j+voQmdguBeS1P7ouWLkjhzUA+RmHUun8uHvqlZ2gzKiQlr391X1DMbdRZ7PcHMS TnHKT39N7TLVj2h98fUwX4WiumkAqiAPAUIRn96UQIviOm7L+YeNiV1mue6HL+SX 2AWX50CC07D3krreuEGydJUKHdfk2WiVzvU9G4u4vNdHWFtCjFc4XCRZwnbqKc2x YWW49/y/khpkYExkjEJRNplIMRHTdOkby/zHs+aAxz9bvq5Awn/cIH0soH8m3yNC GRUJtxm63hEtT5Qow1+Y53lujvZr4Of12AgfNJ6GQ1lYUQVVpUZk+uQRP9MyT4ZQ hwQeAGueudA7GLLHsLYr4BX2FUgBuKftS35rv2fCtG2zRRhkd8A9B7SmV3a84LbR AT/SMa76Sob3UW55PqTTI6F2xGcg9pPiArrnnUUWlXi4hIHTgTiHkJ1riuAdvHPa XxnCEGHCdS9e4yXE0IrOP6o+fkxNsBYJ5NfR3SrqAMCbsDH/NbiLMKg4HiyG+tso A+g7zOSuzL45+bRIKt/F =mb6P -----END PGP SIGNATURE----- --NMuMz9nt05w80d4+--