Re: [Nagios-devel] Bug report: downtimes beyond 2038 cause event
Re: [Nagios-devel] Bug report: downtimes beyond 2038 cause event
On 9 Apr 2013, at 19:35, Andreas Ericsson wrote:
> On 04/08/2013 02:12 PM, Ton Voon wrote:
>>=20
>> RHEL5 32 bit:
>> long =3D 4
>> time_t =3D 4
>> tv =3D 8
>> pqueue_pri_t =3D 8
>>=20
>>=20
>> RHEL5 64 bit:
>> long =3D 8
>> time_t =3D 8
>> tv =3D 16
>> pqueue_pri_t =3D 8
>>=20
>=20
> Ah. Obviously. We're truncating 16 bytes down to 8 for priority,
> checking, but retain the 16 bytes to check if it's time to actually
> run the event yet, so we hang in the event execution loop when
> we come across such events.
>=20
> I've committed a fix which will allow events to be scheduled
> until year 141166 for 64-bit systems (43 bits). It's not
> possible to extend the time for 32-bit systems, so if you think
> you managed to schedule things beyond year 2038, you were wrong.
>=20
> That last point is sort of important though. It's still possible
> to schedule things that appear to be far into the future that
> actually run straight away. We can't do anything about that, because
> in lib/squeue we can't differ between "far in the past" or "far into
> the future", since the value is already wrapped when we get it there.
It appears that in Nagios 3, if you schedule a downtime to end in the =
year 2113 on a 32 bit system, it is silently ignored and no downtime is =
marked. I think that's reasonable - someone will just schedule again =
with better values. This happens on a 32 bit system in Nagios 4 too.
If you schedule downtime on a 64 bit system in 2113 on Nagios 3, then it =
is accepted.
So what happened was that some downtime was set in 2113 in Nagios 3, and =
then when Nagios 4 read the accepted value in retention.dat, it =
triggered this event queue error.
I guess you could get strange values if you transitioned from a 64 bit =
system to a 32 bit system, but that would be unlikely.
> We will not, however, stop running events anymore.
I've just tried to recreate the error and your fix allows the event =
queue to continue, so I can confirm this is fine now.
Ton
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: ton.voon@opsview.com