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

Heinz Junkes (@junkes) gitlab at rtems.org
Tue Nov 18 10:51:51 UTC 2025



Heinz Junkes created an issue: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/issues/69



## Summary
rtems libbsd 7-freebsd-14

git clone https://gitlab.rtems.org/rtems/pkg/rtems-libbsd
cd rtems-libbsd
git checkout 7-freebsd-14

Test on PowerPC (Beatnik-Board), RTEMS 7 (master)

assert error:  file "../../testsuite/selectpollkqueue01/test_main.c", line 1138, function: test_kqueue_close

 /*
         * It is not allowed to close file descriptors still in use by
         * kevent().  On FreeBSD the file descriptor reference counting would
         * prevent this also.
         */
        send_events(ctx, EVENT_SHUTDOWN);

        rv = fstat(cfd, &st);
        assert(rv == 0);
        assert(st.st_mode == (S_IFSOCK | canrecv | cansend));

        rv = kevent(kq, NULL, 0, &event, 1, timeout);
        assert(rv == 1);
        assert(event.ident == cfd);
        assert(event.filter == EVFILT_READ);
---->         assert(event.flags == EV_EOF);
        assert(event.fflags == 0);
        assert(event.data == 0);
        assert(event.udata == TEST_UDATA);

        /*
         * The master task wakes up during the shutdown() operation.  So we do
         * not see the full shutdown.
         */
        rv = fstat(cfd, &st);

## Steps to reproduce

run testsuite/selectpollkqueue01

assert error:  file "../../testsuite/selectpollkqueue01/test_main.c", line 1138, function: test_kqueue_close



<!-- Pre-set options
- milestone
-->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/issues/69
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/20251118/24ac6f90/attachment.htm>


More information about the bugs mailing list