From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by sourceware.org (Postfix) with ESMTPS id 651583851C0B for ; Fri, 8 May 2020 10:10:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 651583851C0B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MBmI6-1jPHGV3wce-00C8zk for ; Fri, 08 May 2020 12:10:15 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6130FA80656; Fri, 8 May 2020 12:10:15 +0200 (CEST) Date: Fri, 8 May 2020 12:10:15 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: ECONNABORTED and ECONNRESET on TCP socket using recv() Message-ID: <20200508101015.GI3947@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <008001d62513$42ec3130$c8c49390$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <008001d62513$42ec3130$c8c49390$@gmail.com> X-Provags-ID: V03:K1:0v/E+Jk1PajwzGWCqzkaDORYF+CHUAJByDq2Io7Drq4JosXRgUH frUVSgmQNK3uXadP/fX+zq/563eRAW+xxZNsGBgbPIaC3OuNqphhAxM3EMeDV3LVgXuDri+ OJNUvJYdv8Psl1D+K0ZkQpx72hBLuoCt4s+Yhq7z64O3OeE3AWeTge2KZtpNKEcG/qjc2JK /ryhBtMm48OCxgWnLjuKg== X-UI-Out-Filterresults: notjunk:1;V03:K0:lamc7twE4vQ=:qJYn9vipAdJ1J9GWqQqRmR RIJhXVyq/Mxlh8n0v9xmfT0UZ/yCBMrtGRA7PKcMeqfsRtSBEJu1aZHDkjEmLAT6AcnhTq8Wi atzxF70A9wS/Pv0Owhi8QJTF6Lcvr+i7SeuvfhcK8cpe9qVjfgSUzRsMOMLZLSAIh5A0s668N CB+a4bIQ6Mt+pOEtq9RWFWEwx8L5+plxtU9CwhTlxbL93QCFxdpBSwY4dKFDQzDOo67jl97ZU pEmjALM6YYgxnFjqjH+jSN/Rk0MdkTgyTQKoZOXw7HyL5WdwsxNuMpHYFO5wgLAntjDQBER92 dkhkPYPSwsdK5NP+vTCHJxQIOh+cMq5dAbTdlVLQUaXPIbY1I7LxIHIu7SLKlk4IJAFGOA+64 p1DfEiXG5mKwisCUOY/aGjd3xtaRKf5dZYBFsuDD+0fcwCwg/w+0oHsZNdw4Ec7GsbiOBHdqB TrqyTA7u5sjTEN5CC2wk53RvrPFrJGwazEa0LeaArKnxBTJlgWtqWh9pHineTy9QyG3FLvFZ/ NdDW0I4Cs9aAIC9xXLZbQUjsZUrJbB1uKb92VNdGcjpEbgsH0dqjadCkmYZY7l6V43OYfk3Bd tCgIti2a1YRApyRZu8rvQH3BEkbn6QHKYmUfXFPZ0ZQEqnu+C0/R/AykG9CA/5FMLBshABy1l vqM7H3oq+vzVXcHa3YDG8Ln9FOb4EC8fyAnPQejKT5RGzL2pKRW8gKWp+OeYM/EzwAR1UTjb7 YIxMQBdJBwyJvwlzQ6t6TfM1rY9B/EH35gdWo2AbDUcf1dEhxvYOrozwcEbS5UVipzZXO+PB+ q+QFfvyx6VREHXJBhXUXUSctbHi5iE5GvkwaEJO8la9FPVzAfjQ8KM5ttPYHw2GbHa/OCxW X-Spam-Status: No, score=-98.4 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2020 10:10:19 -0000 On May 8 10:32, Kristian Ivarsson via Cygwin wrote: > 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) The errors are generated by the called Windows function WSARecvFrom. We'd need a reproducible testcase for this to allow debugging. > 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) It's a toggle, multiple -f on the cli will switch it multiple times. The fact that the default is to follow forks is pretty old, commit f69af9b3d2352 from 2002. Corinna -- Corinna Vinschen Cygwin Maintainer