248 days

Mattias Geniar, Saturday, May 2, 2015

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.



Hi! My name is Mattias Geniar. I'm a Support Manager at Nucleus Hosting in Belgium, a general web geek & public speaker. Currently working on DNS Spy & Oh Dear!. Follow me on Twitter as @mattiasgeniar.

Share this post

Did you like this post? Will you help me share it on social media? Thanks!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Inbound links