From nobody Fri Sep 10 18:56:04 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 84DDD17B9925 for ; Fri, 10 Sep 2021 18:56:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H5lT03F4Rz4v46 for ; Fri, 10 Sep 2021 18:56:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BB121267C for ; Fri, 10 Sep 2021 18:56:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 18AIu4Yk003918 for ; Fri, 10 Sep 2021 18:56:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 18AIu4MD003917 for bugs@FreeBSD.org; Fri, 10 Sep 2021 18:56:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 258412] kevent EVFILT_TIMER, EV_DISPATCH lost if event is re-enabled Date: Fri, 10 Sep 2021 18:56:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: a.cudbardb@freeradius.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258412 Bug ID: 258412 Summary: kevent EVFILT_TIMER, EV_DISPATCH lost if event is re-enabled Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: a.cudbardb@freeradius.org Currently expanding libkqueue tests. libkqueue implements kqueue for Linux, Solaris and Windows as a userland library. One test - test_kevent_timer_dispatch - appears to fail on both macOS 11.5.2 and FreeBSD 13 but for different reasons. Test steps are below: - Add a new timer, EV_SET(kq, 4, EVFILT_TIMER, EV_ADD, EV_DISPATCH, 0, 200, NULL) - Call kevent, wait for timer to fire. - Verify one kevent was returned the the correct flags and data field set t= o 1. - Wait 500ms. - Verify no more kevents are available. - Re-enable timer, EV_SET(kq, 4, EVFILT_TIMER, EV_ENABLE | EV_DISPATCH, 0, = 200, NULL) - Verify no events are generated instantaneously. The above step fails on FreeBSD 13, we get one event with the data field se= t to 1. - Wait 1s - Check that exactly 1 event has fired. The above step fails on macOS, we get one event with the data field set to = 5. Adding EV_ADD to the call re-enabling the timer does nothing, as does only passing EV_ENABLE. To run the test suite containing the failing test: git clone https://github.com/mheily/libkqueue.git cd libkqueue cmake . test/CMakeLists.txt -DWITH_NATIVE_KQUEUE_BUGS=3D1 make -C test/ ./test/libkqueue-test timer You'll need the cmake, git, and gcc or llvm pkgs installed. There are no o= ther dependencies. The actual test is available here: https://github.com/mheily/libkqueue/blob/935ebc39f78d2e06ce0d20f6c297e4b2b7= e4c1bc/test/timer.c#L122 I believe FreeBSD pulled in libkqueue's test suite at some point in the dis= tant past. The test framework hasn't changed much in the past 10 years so you m= ay be able to just drop the updated test in. --=20 You are receiving this mail because: You are the assignee for the bug.=