[Bug 735] New: Gnu/Linux fosi is not robust against system clock/date adjustments.


Summary: Gnu/Linux fosi is not robust against system clock/date
Product: RTT
Version: 0.18.0
Platform: All
OS/Version: GNU/Linux
Status: NEW
Severity: major
Priority: P3
Component: Operating System Abstraction - Portability
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Due to fixing bug #653, the time measurement in gnulinux systems is done with
CLOCK_REALTIME instead of CLOCK_MONOTONIC. When the system time is adjusted,
for example during daylight savings adjustments, all periodic threads, or
threads waiting for a timeout may halt until the adjustment has passed (for
example, 1 hour).

The Linux semaphores we use only accept CLOCK_REALTIME, which is why we were
'forced' into using this clock.

Users of RTT 1.8 and later should not adjust system clocks or dates in case
they are running a gnulinux targeted Orocos application. The work around is to
do the adjustment when not executing an Orocos application, for example, during
system boot or shutdown.

A possible fix in the gnulinux fosi layer of RTT is to keep track of both
clocks and allow each primitive to choose which one to use, preferably
CLOCK_MONOTONIC. Each time measurement would then read both clocks however,
which is a performance penalty specific to the gnulinux target.