LibBSD | libbsd kqueue TCP peer close/reset notifications appear to be lost, maybe due to absence of NOTE_EOF? (#69)

Chris Johns (@chris) gitlab at rtems.org
Sun Mar 29 23:09:53 UTC 2026




Chris Johns commented: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/issues/69#note_147375


The test change I made is:

```
diff --git a/testsuite/selectpollkqueue01/test_main.c b/testsuite/selectpollkqueue01/test_main.c
index 7bf7768c..92e36840 100755
--- a/testsuite/selectpollkqueue01/test_main.c
+++ b/testsuite/selectpollkqueue01/test_main.c
@@ -197,6 +197,7 @@ worker_task(rtems_task_argument arg)
                        puts("worker: read");

                        n = read(ctx->rfd, &ctx->rbuf[0], ctx->rn);
+      printf("n=%i rn=%i\n", n, ctx->rn);
                        assert(n == (ssize_t) ctx->rn);
                }
```

The full test result on Microzed hardware with SMP is:

```
*** BEGIN OF TEST LIBBSD SELECT, POLL, PPOLL, KQUEUE AND PIPE 1 ***
*** TEST VERSION: 7.0.0.d6eb668ac4b7c11b9c1e52a499f04d4aaffa1451
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API RTEMS_SMP
*** TEST TOOLS: 15.2.0 20250808 (RTEMS 7, RSB 1e9aa3d11a17e459389edf02f208eebca467be8f, Newlib 038afec1)
nexus0: <RTEMS Nexus device>
info: lo0: link state changed to UP
test select timeout
test select connect
worker: create new connect socket
worker: connect
test select read
worker: write
test select write
worker: read
n=4096 rn=4096
test select close
worker: close
test pselect sigmask
test pselect timeout
test poll timeout
test poll connect
worker: create new connect socket
worker: connect
test poll read
worker: write
test poll write
worker: read
n=4096 rn=4096
test poll close
worker: close
test ppoll timeout
test ppoll sigmask
test ppoll connect
worker: create new connect socket
worker: connect
test kqueue timer
test kqueue timer
test kqueue connect
worker: close connect socket
worker: create new connect socket
worker: connect
test kqueue read
worker: write
test kqueue write
workeassertion "event.flags == EV_EOF" failed: file "../../testsuite/selectpollkqueue01/test_main.c", line 1139, function: test_kqueue_close
```

**_Note:_**

1. You can see the lines with the printed output showing the values match. Without the print the values do not match so I am not sure if the read is partial and not full, ie synchronous.
2. If there are timing related issues the close problem may be related

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/issues/69#note_147375
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260329/2e99ab81/attachment.htm>


More information about the bugs mailing list