Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2023 22:34:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 212716] recv() with MSG_WAITALL doesn't always unblock on EOF
Message-ID:  <bug-212716-227-8f5Se4zA0S@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-212716-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-212716-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212716

--- Comment #6 from Greg Becker <greg@codeconcepts.com> ---
I am also able to repro with 15.0-CURRENT.

The problem seems to be that we are not rechecking the socket receive buffer
for errors or to see if the peer closed after calling pr_rcvd() (around line
2430 in file uipc_socket.c), having dropped the socket receive buffer lock
before the call and then reacquiring it after the call.  Which is to say, t=
he
socket state can change once the receive buffer lock is dropped, and hence
previous assertions made while the lock was held cannot be relied upon...

I've attached an initial patch, but I need to spend more time reviewing the
code, as it's not clear to me yet whether we should be exiting the MSG_WAIT=
ALL
loop at line 2522 if the receive buffer contains valid data.  Perhaps someo=
ne
more familiar with this code and chime in...

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212716-227-8f5Se4zA0S>