Re: [chrony-dev] apply_step_offset() in sys_macosx.c

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Sun, Dec 06, 2015 at 02:26:41PM +0700, Gerriet M. Denkmann wrote:
> apply_step_offset( offset = 10 minutes ) gets called on 12:17:00
> 	stop_adjust() sets T0 = 12:17:01	(this is a very slow example)
> 	old_time = 12:17:02
> 	new_time = 12:07:02	//	new_time = old_time - offset
> 	settimeofday( 12:07:02 )
> 	T0 = 12:27:01	//	T0 += offset
> 	
> 	start_adjust does:
> 		T1 = 12:07:03
> 		elapsed = T1 - T0 = 12:07:03 - 12:27:01 = -20 minutes + 2 seconds
> 		accrued_error = current_freq * (almost -20 minutes)
> 
> This I guess is not quite right.
> With “-offset” the accrued error would be current_freq * 2 seconds, which makes more sense to me.

I think you are right, this does look like a bug. Apparently it was in
all adjtime() based drivers. After a large step there would be an
incorrect adjustment of the clock, which would throw off the loop and
it probably needed couple updates before it could settle down again.
This should be observable in offsets in the tracking log.

Do you want to prepare a git patch?

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/