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

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


On Mon, Dec 4, 2017 at 5:14 AM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> 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().

In one of my cases where I saved some strace output, it seems to show
what you suggest:

select(4, [3], [], [], {18446744073709203787, 668311}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668293}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668275}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668255}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668237}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668219}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668200}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668181}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668163}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668146}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668128}) = -1 EINVAL
(Invalid argument)
select(4, [3], [], [], {18446744073709203787, 668110}) = -1 EINVAL
(Invalid argument)

-- 
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/