Created attachment 269066 [details] The source code to reproduce the bug We noticed a different behavior of kevent between the version 15.0 and 14.3 which looks like a bug in 15.0 You can find attached an example of code to reproduce the behavior. The issue is a missing kevent notification when the remote side of an unix socket is closed. This occurs under the following context: - a write has been made on the local side of the socket to fill the write buffer before the remote side is closed. - another kevent call is made before closing the socket, unrelated to the socket operations. In my example, we create an EVFILT_TIMER and wait for it. I tried to git bisect but it's taking too much time and I failed to completely automate it. However, so far so I saw the issue in base d17bfb237065587c72db05a5bafc6bcab1206cb9 while base 712806fc4b5470eb7d9ce537e3cdf3b386455d86 works fine. Is it a real bug, or did I forgot something in my code to be notified on closed connection ?
Created attachment 269067 [details] The ktrace on FreeBSD 14.2 (expected behavior)
Created attachment 269068 [details] The ktrace on FreeBSD 15.0 (missing notification for socket)
I finally managed to have a bisect script, it seems that the change was introduced by base d15792780760ef94647af9b377b5f0a80e1826bc
I believe https://reviews.freebsd.org/D56764 will fix this.
(In reply to Mark Johnston from comment #4) Your patch fixes the tests of devel/canpnproto, see #294259 .
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=476805133f5736c2c8638e41d2b5d8dd2c597f3a commit 476805133f5736c2c8638e41d2b5d8dd2c597f3a Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-05-03 15:46:22 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-05-03 21:51:49 +0000 unix: Make sure we signal EOF on the write side when disconnecting Add a regression test. PR: 294014 Reported by: diizzy Reviewed by: glebius MFC after: 1 week Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket") Differential Revision: https://reviews.freebsd.org/D56764 sys/kern/uipc_usrreq.c | 2 ++ tests/sys/kern/unix_stream.c | 77 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 17 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f06697907f360b02682594c6179a7361644d3c87 commit f06697907f360b02682594c6179a7361644d3c87 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-05-03 15:46:22 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-05-09 19:16:02 +0000 unix: Make sure we signal EOF on the write side when disconnecting Add a regression test. PR: 294014 Reported by: diizzy Reviewed by: glebius MFC after: 1 week Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket") Differential Revision: https://reviews.freebsd.org/D56764 (cherry picked from commit 476805133f5736c2c8638e41d2b5d8dd2c597f3a) sys/kern/uipc_usrreq.c | 2 ++ tests/sys/kern/unix_stream.c | 77 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 17 deletions(-)
A commit in branch releng/15.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=037b285b80e5cb35c8e9cec4e85966b20f03d91a commit 037b285b80e5cb35c8e9cec4e85966b20f03d91a Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-05-03 15:46:22 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2026-05-09 20:44:04 +0000 unix: Make sure we signal EOF on the write side when disconnecting Add a regression test. Approved by: re (cperciva) PR: 294014 Reported by: diizzy Reviewed by: glebius MFC after: 1 week Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket") Differential Revision: https://reviews.freebsd.org/D56764 (cherry picked from commit 476805133f5736c2c8638e41d2b5d8dd2c597f3a) (cherry picked from commit f06697907f360b02682594c6179a7361644d3c87) sys/kern/uipc_usrreq.c | 2 ++ tests/sys/kern/unix_stream.c | 77 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 17 deletions(-)