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
Unknown Object (File)
Tue, Dec 10, 10:50 AM
Unknown Object (File)
Nov 18 2024, 3:56 PM
Unknown Object (File)
Nov 2 2024, 8:14 AM
Unknown Object (File)
Oct 9 2024, 11:29 AM
Unknown Object (File)
Oct 9 2024, 8:15 AM
Unknown Object (File)
Oct 9 2024, 8:14 AM
Unknown Object (File)
Oct 9 2024, 7:50 AM
Unknown Object (File)
Oct 4 2024, 11:11 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.