[RTEMS Project] #4179: libbsd select timeout issue

RTEMS trac trac at rtems.org
Tue Nov 17 01:45:41 UTC 2020

#4179: libbsd select timeout issue
  Reporter:  Zhengxin Rui    |      Owner:  (none)
      Type:  defect          |     Status:  new
  Priority:  normal          |  Milestone:
 Component:  network/libbsd  |    Version:  5
  Severity:  critical        |   Keywords:
Blocked By:                  |   Blocking:
 Kernel put the select thread to sleep queue in sleepq_set_timeout_sbt,
 the expire value is calculated by this
 expire = (sbt - SBT_1S + sbt_per_tick - 1) / sbt_per_tick;
 sbt is the absolute time,no time drift.
 but the sbt_per_tick is not an accurate value,
 it can make the expire vaule bigger and bigger while sbt is increasing.

 In rtems_bsd_initialize function,
 rtems_bsd_sbt_per_watchdog_tick = SBT_1S / tps;

 In our system the tick rate is set to 1000Hz,
 the real value of rtems_bsd_sbt_per_watchdog_tick is
 but in integer type the value is 4294967.
 The error is 0.296/4294967 = 0.069ppm,
 and it can increase the expire value 1ms every 14000 seconds.

Ticket URL: <http://devel.rtems.org/ticket/4179>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list