[Bug 693] Invalid timeval passed to setitmer()

bugzilla-daemon at bugzilla.openmoko.org bugzilla-daemon at bugzilla.openmoko.org
Wed Oct 10 01:57:12 CEST 2007


------- Additional Comments From ticktock35 at gmail.com  2007-10-10 01:57 -------
 When calculating the next expiration, the timer should not be expired already.
But if so, we may need to figure why and what should we do to deal with this.
In this case, we see the system is changed forward and so that the expired time
in timer is expired.
In other case, we may found that if a system is too busy and context switch
quickly, this may also happened.

In my patch (id=339),  when calculating the next expiration and found that the
oldest one has been expired, I give it a second try.  That is, pretending this
timer is registering at this moment, and setting timer with the interval that
user set.

The first thing we should figure out is "what should we do when timer is expired?"
In my opinion, this is an abnormal condition, and we should try to set another
alarm to call those expired timer.
In the case of changing system time, gsmd should wait for a moment and so that
reset the timer is suit for this case.
However, in the case of system too busy, it may need to send SIGALRM immediately.

In order to make gsmd robust, these two conditions should be considered well.
In that patch id=339, there is a weakness:
If timer A registered at 00:00 and interval is 15 sec, and timer B registered at
00:13 and interval is 3 sec.
If the system time changed at 00:14 from 00:14 to 00:20, both timer A and B are
In this patch, A will be selected and another 15 sec will be waited. That is B
will wait for extra 13 sec.

Therefore, I have to reject my patch (id=339)

A better way to handle this abnormal condition is to find out the latest
registering time, and recalculate all the expired timer. Pretending the current
time is the latest registering time, and recalculate all the expiration of
expired timer.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the buglog mailing list