Re: [chrony-dev] Patch: avoid infinite select() loop on chronyc

[ Thread Index | Date Index | More Archives ]

On Mon, 4 Dec 2017, Miroslav Lichvar wrote:

I suspect the real problem is with the timeout. If it was negative,
select() would return EINVAL and the loop would not terminate. I guess
this could happen if chronyd (or something else) stepped the system
clock forward right between the first gettimeofday() call before the
request is sent and the second gettimeofday() call before select().

Could that be what happened in your case?

I think you are correct - there was a possibility of some clock step happening on the system

I think the fix should be to check the timeout after its calculation.
If it is negative, a new attempt should be made.

I still think we need to limit bound the bnmber of attempts. Making the assumption tat the next time around on a new attempt things will be different is too risky. I'd rather have chronyc exit unsuccessfully than keep trying forever the same codepath that already failed once...



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+