From nobody Thu Apr 4 09:43:22 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9Gs44c9wz5Gg5H for ; Thu, 4 Apr 2024 09:43:36 +0000 (UTC) (envelope-from michael.tuexen@lurchi.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9Gs42CQ3z4vqG for ; Thu, 4 Apr 2024 09:43:36 +0000 (UTC) (envelope-from michael.tuexen@lurchi.franken.de) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (ip4d15f54e.dynamic.kabel-deutschland.de [77.21.245.78]) (Authenticated sender: lurchi) by mail-n.franken.de (Postfix) with ESMTPSA id D355E721E2817; Thu, 4 Apr 2024 11:43:31 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: TCP socket handling errors From: Michael Tuexen In-Reply-To: <20240403184638.aaf842926a7665d1f7fc8b14@gmail.com> Date: Thu, 4 Apr 2024 11:43:22 +0200 Cc: "freebsd-net@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <9575FAEA-E297-47B2-9F32-733C8AC2803F@lurchi.franken.de> References: <20240403131434.c3bfa64c726505d842408c80@gmail.com> <20240403144445.9a5662aa66975430c73f9e6d@gmail.com> <0BA9AF99-A50F-472F-8139-1BA9EA067F91@lurchi.franken.de> <20240403184638.aaf842926a7665d1f7fc8b14@gmail.com> To: Sad Clouds X-Mailer: Apple Mail (2.3774.500.171.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Queue-Id: 4V9Gs42CQ3z4vqG > On 3. Apr 2024, at 19:46, Sad Clouds wrote: > > On Wed, 3 Apr 2024 17:28:52 +0200 > Michael Tuexen wrote: > >>> On 3. Apr 2024, at 15:44, Sad Clouds wrote: >>> >>> I found a bug that is still open from May 2010 and describes the same >>> behaviour that I see with my application: >>> >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=146845 >>> >>> If this hasn't been fixed over the last 14 years, then I guess I will >>> add some code to simply ignore ECONNRESET on close(2) for FreeBSD and >>> MacOS. This seems the be the general advice from other people who hit >>> this issue. >> I'll bring this up on the bi-weekly FreeBSD transport call. >> >> Best regards >> Michael >>> >> > > Hello, I've attached a test program, this easily reproduces the issue > on Raspberry Pi 4 within a few seconds of running it. > > Server output: > $ ./econnreset server > Server: accept() > Server: shutdown() > Server: close() > ... > Server: accept() > Server: shutdown() > Server: close() > close() failed, error=Connection reset by peer > > > Client output (aborts when server exists due to close() failure): > $ while true; do ./econnreset client || break; done > Client: connect() > Client: shutdown() > Client: close() > ... > Client: connect() > Assertion failed: (int_val == 0), function client, file econnreset.c, > line 156. Abort trap (core dumped) > I can reproduce this locally. Best regards Michael