Bug: router uptime resetted after 492 days

Hi all,
we have a bunch of routers (different models, RB450G, RB2011, CCR1016-12G) that are running firmware 6.37.1 (stable).
Fortunately, all were having an uptime of about 492 days (I cannot recall the exact value).

Now, a very strange thing happened.
They suddendly show a short uptime (few hours), as they were rebooted. But they were not!
Actually, the log shows that every router worked continously without interruption.
Just the uptime value is wrong. Also OSPF adjacency and other times are wrong (they show something like 470 days, not possible).

Is there any timer overflow at about 492 days on RouterOS?
Maybe Mikrotik engineers did not expect such a long uptime on their devices? :slight_smile:
Has this been corrected on the newer firmwares?

Massimo

Wow, last time I saw something with such a long uptime was a Novell server :slight_smile:

492 days is surprisingly close to maximum number of hundreds of a second, stored in a signed 32 bit variable.

2^32 = 4294967296, if that number is hundreds of a second, it would translate to 497 days, 2 hours, 27 minutes and 52.96 seconds.

My theory does not cover the difference between 492 days (if your observation is correct) and calculated 497 days.

That is right, it is a wellknown issue in Linux systems and when querying uptime via SNMP in 32-bit variables.
The uptime wraps around when the 32-bit value overflows.

I think you’re right mkx… probably it happened at 497 days, I did not remember exactly because I looked into it some days ago.
Good to know!