delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/04/23/08:46:34

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=HDyqPKfaZBe9x6VCv9lbflxgHH3qBzEQrHXZIEzTRYnylosd08CZe
V/uBILykCPTBtwqo8QJqIuSU7vCTRd1AsnhqzMLD0qW9oUCCKrWEFIY0fk8RvSh8
J/K+gcT9e7ANdqvcnaHLcj2sCSM5uAczaVX+9DsoXZLdmj8OiwTGFE=
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=g6vXpCpwI8QYa8szLgUr/9yV/Pk=; b=g6ote+7BmONzuGnG7KZl29fCNkVY
EVp6raNBkevlr+74m6KNWfYhUVC3GgygLtnkkQrOuUcBCXD4nc1VbmT0PbTx4iWp
pKARHfHhxeehfuFcwBbJZ1i/GkcA8qx4r5hFzzsLt6fwVtiDfi7XRNsJ/Fh+sHiS
HCvyc91fyQChq+4=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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-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
Date: Tue, 23 Apr 2019 14:46:19 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: EPERM on bind() ?
Message-ID: <20190423124619.GC30041@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAOTD34a_LJP5kk==DzkHz89PFjjPFcXWM1eDFVx+4uNf6XbCjw AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAOTD34a_LJP5kk==DzkHz89PFjjPFcXWM1eDFVx+4uNf6XbCjw@mail.gmail.com>
User-Agent: Mutt/1.11.3 (2019-02-01)

--Clx92ZfkiYIKRjnr
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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"

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019