Page MenuHomeFreeBSD

kevent(2): wrong EVFILT_TIMER timeouts when using NOTE_NSECONDS
ClosedPublic

Authored by gbe on Jan 9 2021, 5:42 PM.
Tags
None
Referenced Files
F97571541: D28067.id.diff
Mon, Sep 30, 3:17 AM
Unknown Object (File)
Sun, Sep 29, 2:28 AM
Unknown Object (File)
Wed, Sep 11, 8:41 AM
Unknown Object (File)
Fri, Sep 6, 3:44 AM
Unknown Object (File)
Wed, Sep 4, 6:59 PM
Unknown Object (File)
Aug 30 2024, 2:54 AM
Unknown Object (File)
Aug 21 2024, 12:43 AM
Unknown Object (File)
Aug 19 2024, 10:42 PM
Subscribers

Details

Summary

kevent(2): wrong EVFILT_TIMER timeouts when using NOTE_NSECONDS

From the PR: There is a typo in "timer2sbintime" (sys/kern/kern_event.c) when converting NOTE_NSECONDS to sbintime_t. For the nanosecond part US_TO_SBT instead of NS_TO_SBT is used. This results in weird timeout values.

PR: 252539
Submitted by: Jan Kokemüller <jan dot kokemueller at gmail dot com>

Test Plan

buildworld and a kyua test run

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36064
Build 32953: arc lint + arc unit

Event Timeline

gbe requested review of this revision.Jan 9 2021, 5:42 PM

We should also incorporate Jan's reproducer into the test suite, but I can do this after the fact.

Note that the "Submitted by" could be dropped if you recommit locally with git commit --author="Jan Kokemüller <jan.kokemueller@gmail.com>". I haven't seen any particular guidance one way or the other, but IMO the commit metadata attribution is more aesthetically pleasing.

This revision is now accepted and ready to land.Jan 9 2021, 5:47 PM

We should also incorporate Jan's reproducer into the test suite, but I can do this after the fact.

Note that the "Submitted by" could be dropped if you recommit locally with git commit --author="Jan Kokemüller <jan.kokemueller@gmail.com>". I haven't seen any particular guidance one way or the other, but IMO the commit metadata attribution is more aesthetically pleasing.

I'll do it once I commit the patch to main. Does your approval implies an "approved by: kevans"? ;-)

What could be done there, besides tests, is assert that e.g. converting SBT to NS (sbttons()) gives the original value. Or may be this is too naive, it should be orig value within some epsilon.