Re: TCP socket handling errors

Michael Tuexen <[email protected]>
Newsgroups gmane.os.freebsd.devel.net
Message-ID <[email protected]>
> On 3. Apr 2024, at 19:46, Sad Clouds <[email protected]> wrote:
> 
> On Wed, 3 Apr 2024 17:28:52 +0200
> Michael Tuexen <[email protected]> wrote:
> 
>>> On 3. Apr 2024, at 15:44, Sad Clouds <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.