From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58053 invoked by alias); 23 Apr 2019 12:46:24 -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 58044 invoked by uid 89); 23 Apr 2019 12:46:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-102.3 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=wondering, H*F:D*cygwin.com X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Apr 2019 12:46:23 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MjSHc-1gYKnO2OQE-00kx27 for ; Tue, 23 Apr 2019 14:46:20 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6DA22A80772; Tue, 23 Apr 2019 14:46:19 +0200 (CEST) Date: Tue, 23 Apr 2019 12:46:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: EPERM on bind() ? Message-ID: <20190423124619.GC30041@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Clx92ZfkiYIKRjnr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-04/txt/msg00162.txt.bz2 --Clx92ZfkiYIKRjnr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1645 On Apr 23 14:17, E. Madison Bray wrote: > Hello, >=20 > I have had some users of the Jupyter Notebook [1] on Cygwin report an > crash on startup where, when the Notebook server tries to bind() to > the port it will listen on (TCP 8888) the bind() fails and errno is > set to EPERM, which is not an expected errno from bind(). >=20 > Looking at the Cygwin sources, in net.cc I see that in > set_winsock_errno, EPERM is returned by default if there is some WSA > error for which there is no POSIX equivalent mapped. Fine--EPERM is > as good as any other fallback I suppose (?) in that it unambiguously > indicates some unknown WSA error. This code is as old as it can get. The Winsock error fallback to EPERM predates the Cygwin import into the public CVS repo on sourceware.org in 2000, and the pre-2000 ChangeLogs don't mention it. There's a good chance the mapping defaults to EPERM since 1996 when the first socket support was added. It's probably a good idea to change the default to EACCES, as for other, non-WinSock errors. > I'm just wondering if anyone has any idea what might cause such an > error. Nobody knows. The problem is that we only know the POSIX fallback but not the actual WSOCK error code. If you can manage to run the server under strace to reproduce the issue, then there will be an error message in strace along the lines of "fhandler_socket*.cc:42 - winsock error 12345 -> errno 1" The point here is to know what winsock error code that actually is. What we can do then is to map it to a better POSIX error code or maybe even see if there's a bug in Cygwin. Corinna --=20 Corinna Vinschen Cygwin Maintainer --Clx92ZfkiYIKRjnr Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAly/CRsACgkQ9TYGna5E T6DBhw//RzcE0d2/hY9hz1Kzcz51o/PA56x/wCsiUTdEviAw9tqJCbAgBv48Z1xy 31bIJ8xpGa3q9LPAzuR7QNKs5wYZB0pTH4PpGAN/kHIRL/KzDtRmZx2iByTQtWRA MQySgl4DVCRmRXyHiQA0mWoJK2GZQyECKOikweC+j1jYz5PL4uw+UQCHiWsWlgSf 3E3A0ReBjgU4lM5HdWKTlkhrsqxeblXYB2XqqtxFeEgBdbhyytPApdqhQKKkWF4h AkP7M5CY3Z3DSVEzT7/L2cZxniOV0X+cM9K7eChd9hU/0s7CK99T6SqjSMG1lcvX snlrzCrcYTSfiwa5hItZIw5/hhuJ/PSXygrIKakMN7RsXI6v+up1i4N1s4/N3UOJ MIhLRbnD9Agtp8WIzOBtfkbqGZMetqAfsfb2avBJJT4R9RUBWfQYyUJNiZGLKqsz 46hcxLWFNgtW04fRsjN4efXjuPCcZCVQde/m4HL32XDlYLJJYjewjBoGybpw/EX5 s8EOApsN40uRRRfP0QJZ6lPtU0M23mvu4C071lQBBQuPwlqhL40d1F0k6Znk78GN 9DKwRQWzbzssfz8yCAzVlUcri08IwrF+nLbPUlIGgeGzk9OaRlEH3nyZlqzFjUI7 EaRFNMErIPEpWq25sQ2yeJfGJsyDOWFpUZ7W+OluwDqj4VRR820= =jfDG -----END PGP SIGNATURE----- --Clx92ZfkiYIKRjnr--