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)
Fri, May 17, 3:43 AM
Unknown Object (File)
Mon, May 6, 3:40 PM
Unknown Object (File)
Sun, May 5, 12:22 PM
Unknown Object (File)
Wed, May 1, 5:21 PM
Unknown Object (File)
Tue, Apr 30, 3:17 AM
Unknown Object (File)
Mon, Apr 29, 8:45 PM
Unknown Object (File)
Sun, Apr 28, 4:04 AM
Unknown Object (File)
Mar 29 2024, 8:25 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.