248 days

Tired of the privacy invasion of the Chrome webbrowser? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. It supports all the same Chrome extensions, with none of the telemetry. It auto-blocks ads and helps support content creators like me.

Give the Brave browser a try »

Profile image of Mattias Geniar

Mattias Geniar, May 02, 2015

Follow me on Twitter as @mattiasgeniar

Or: how a system’s uptime can trigger a buffer overflow.

Let’s do some quick math.

The maximum value a 32bit integer can hold:

2^31 ‐ 1 = 2.147.483.647.

The amount of seconds in 248 days, keeping time to one hundredth of a second accuracy:

248 days x 24 hours x 60 minutes x 60 seconds x 100 = 2.142.720.000.

Those are remarkably close, aren’t they? In fact, as soon as day 248 reaches somewhere around 14:00h, the value exceeds the maximum value a 32bit integer can hold.

Boeing learned this with its 787s.

We have been advised by Boeing of an issue identified during laboratory testing.

The software counter internal to the generator control units (GCUs) will overflow after 248 days of continuous power, causing that GCU to go into failsafe mode.

If the four main GCUs (associated with the engine mounted generators) were powered up at the same time, after 248 days of continuous power, all four GCUs will go into failsafe mode at the same time, resulting in a loss of all AC electrical power regardless of flight phase.

Federal Aviation Administration

Ouch.

This issue reminded me of a problem some Dell EqualLogic storage arrays experienced as well.

While running firmware version 7.0.x, unexpected controller failovers may have occurred at 248 consecutive days of uptime.

Dell EQL firmware v7.0.9

Storing the system uptime in a 32bit integer? Not the best idea, so it seems.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.