Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2024 11:43:22 +0200
From:      Michael Tuexen <michael.tuexen@lurchi.franken.de>
To:        Sad Clouds <cryintothebluesky@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@FreeBSD.org>
Subject:   Re: TCP socket handling errors
Message-ID:  <9575FAEA-E297-47B2-9F32-733C8AC2803F@lurchi.franken.de>
In-Reply-To: <20240403184638.aaf842926a7665d1f7fc8b14@gmail.com>
References:  <20240403131434.c3bfa64c726505d842408c80@gmail.com> <20240403144445.9a5662aa66975430c73f9e6d@gmail.com> <0BA9AF99-A50F-472F-8139-1BA9EA067F91@lurchi.franken.de> <20240403184638.aaf842926a7665d1f7fc8b14@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 3. Apr 2024, at 19:46, Sad Clouds <cryintothebluesky@gmail.com> wrote:
> 
> On Wed, 3 Apr 2024 17:28:52 +0200
> Michael Tuexen <michael.tuexen@lurchi.franken.de> wrote:
> 
>>> On 3. Apr 2024, at 15:44, Sad Clouds <cryintothebluesky@gmail.com> 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)
> <econnreset.c>
I can reproduce this locally.

Best regards
Michael




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9575FAEA-E297-47B2-9F32-733C8AC2803F>