X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67020395CC81
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1588926775;
	bh=PPGTWZAKnbTr3HAylO47H87Fjp9cn+fgSRu15Dwjg5U=;
	h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
	 List-Help:List-Subscribe:From:Reply-To:From;
	b=voASme/1Omw1qOgQgfv8Kcd50zo0oHPv1C4xUI/xW46q6E1RM4ZHg8UpmL75VxTma
	 qH8AW7Hc6xsrWpw7+n4NXAE+t9YQfRxL+axP7FupxAjUzY2FUGCdlAbkLcj0NnZgbw
	 dq5UfK5j1HZoNOIVzgtyigjA3kk/bj9C8+A1Kop4=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 43815385C426
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding:thread-index:content-language;
 bh=7kqY6zAPpz+Zr292YV6bgu/hvbz1EOV8X+RPWGb0shs=;
 b=AOni5yokusyrIWT2K42vtMfNmx7qHYjLucrj6PDHUosuh4hotusa7y6aB3uo1+ee2B
 N0jyEx6yep8fvj0uQ+xt1Fpj+eGaZ8yOCGj9F/XI/3xI+bFUPA4eNQsl+T/LMhyKM0Z2
 X4DdFir0qNoM8PGfF9/It5VdLw52bmC8tJSxmV3bQjf6XN41+7M+1Yi+JD+juFomOBjf
 nM9wygeB+dXRUd/G+vG4Ghp2LQWA/wXT2g01jDWCIE9FS/dG5kI8JD8V0tMf7ED59p4a
 ZBHMnHXw0qK/oevZ0X0kfSOUyNP4fn+ggRlOLBhgM7tM2rZVPfQv4wNUeFz02Cje/veI
 HcQg==
X-Gm-Message-State: AOAM5304urtM9HgyC0SQqeb7igz2dYuiw416YX/PIhD0/bMtF+3GeKCj
 yMsdPj2G4AGwmZroTiUgn+cATetW
X-Google-Smtp-Source: ABdhPJyq+z9ngm0Npyc+IkOcgf3mHMJQFluT21nIlJJfp5dxyI+3KicSGKOa4wV4N6nsfde9FM1iVQ==
X-Received: by 2002:a19:8809:: with SMTP id k9mr1108679lfd.151.1588926771723; 
 Fri, 08 May 2020 01:32:51 -0700 (PDT)
To: <cygwin@cygwin.com>
Subject: ECONNABORTED and ECONNRESET on TCP socket using recv()
Date: Fri, 8 May 2020 10:32:50 +0200
Message-ID: <008001d62513$42ec3130$c8c49390$@gmail.com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdYlDFQvN6jgP7JNTmG/GkSZRpdL2Q==
Content-Language: en-gb
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
 SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Kristian Ivarsson via Cygwin <cygwin@cygwin.com>
Reply-To: sten.kristian.ivarsson@gmail.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

Hi all

Have anyone experienced getting ECONNABORTED and ECONNRESET on local TCP
socket when using recv() ?


We have a fairly complex application where it, amongst others, spawns child
processes (using posix_spawnp)

This is a simplified scenario

- parent performs socket() + bind() + listen() to localhost
- parent spawns a client-child process 
  - client-child is doing socket() + connect() to localhost
  - client-child is doing send()
  - client-child is doing recv() and getting ECONNRESET

- parent performs accept()
- parent spawns a server-child process
  - server-child is doing recv() and getting ECONNABORTED


According to strace, both of these errors originates from
fhandler_socket_inet::recv_internal() (in my version it says line 1221)



Maybe there's some defect in our application (there's a lot of other fuzz
going on as well), but it works in several Linux-implementations but this
error is deterministically occurring using CYGWIN


I've searched mail archives but I cannot really find any explanation or
cause

Does anyone have any knowledge about this ?



Best regards
Kristian

p.s.
   strace -f works in the opposite way as in most Linux-implementation btw
(as far as I understand)
d.s.

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
