News for hackers. Stuff that matters.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by hello_there on Saturday May 02, 2015 @07:02AM (#9476627)
> Nowadays a big plane like the A380 might be expected to have 100M lines of code in its subsystems,

Why does an airplane require 100M lines of code?

Re:Integer Overflow Bug in Boeing 787 Dreamliner by mschuster91 on Saturday May 02, 2015 @07:33AM (#9476688)
Linux kernel alone comes in at 15m SLOC. Now add an userland subsystem and you're at 20-30M just for one device.

Multiply by all the little and big subsystems, the embedded chips, in-flight entertainment, network gear... 100m SLOC is too low, I think.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by georgerobinson on Saturday May 02, 2015 @08:28AM (#9476819)
Sorry if this is incredibly ignorant, but I can't believe flight control systems are running Linux?

Do these systems not have hard real-time requirements about the execution time and periodicity of tasks which can't be guaranteed by the time-sharing scheduling algorithms in Linux?

Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @09:40AM (#9476988)
Real time systems will be running a RTOS: VxWorks or QnX or something equivalent to that.

They'll definitely build a prototype using Linux but they won't get that certified so it literally 'won't fly', it's just a means to speed up initial development.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by Kliment on Saturday May 02, 2015 @02:09PM (#9477947)
Is the order of magnitude of lines of code in QNX different from that of linux? At a first approximation, I don't see why it would be.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @02:12PM (#9477957)
The QnX kernel is very small compared to the Linux kernel.

Small enough that I could-reimplement it in approximately 3500 lines of code + another 850 for the virtual memory management.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by Kliment on Saturday May 02, 2015 @02:36PM (#9478045)
Wow, I had no idea. Since their source is closed and untouchable I had no way to check either. Is there any reason there aren't several certified open RTOSes around?
Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @02:41PM (#9478061)
I don't know if there aren't any open certified RTOS's around, but I can explain the 'why' part easily: if you pay for the certification of an open RTOS then everybody that can use one will say 'thank you' for the effort and that's that, since the certification would apply to any and all copies of that particular version. So you're essentially paying for the privilege of cutting your competitors a break.

This could only work if the entity paying for the certification had a way of making that money back somehow and I don't see how that could be done.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by walterbell on Saturday May 02, 2015 @02:55PM (#9478100)
Not an RTOS, but seL4 is a correctness-proven open-source ARM microkernel: https://sel4.systems. Looks like a mixture of public and private funding. It's part of the L4 family, http://en.m.wikipedia.org/wiki/L4_microkernel_family#Univers... which includes OKL4 (deployed on 1B+ ARM-based mobile phones) and http://genode.org (x86/ARM) from Dresden.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by jeff_marshall on Saturday May 02, 2015 @06:55PM (#9478877)
Not to detract from the fine work done by the sel4 folks, but there is a large gap between what they have and what DO178 C requires for level A software. Like many other bureaucratic organisations, the FAA (and other regional equivalents) have a process with it's own set of rules (MCDC testing, requirements/design traceability artifacts, etc).

It would cost a significant amount of money to develop the necessary artifacts and engage the FAA to obtain a certification.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @07:00PM (#9478892)
That's absolutely true but something like this could be a good starting point.

What I think the whole thread above misses is that the economics simply aren't there, cost isn't the limiting factor for the OS licenses for avionics but an extra certification track (especially for a fast moving target) would be, besides, it is not just the OS that gets certified but you will also have to (separately) certify (usually) the hardware that it runs on (unless you're going to use a design that has already been certified).

That means that modifications are expensive and that 'known to be good' trumps 'could be better' or 'could be cheaper in the longer term'.

Someone would have to come up with a very good reason to see open source trump the existing closed source solutions.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by walterbell on Saturday May 02, 2015 @07:04PM (#9478901)
In theory, while certification would be done on a binary derived from seL4, any improvements resulting from the certification process could benefit the open-source core and derivative binaries. Compared to a proprietary OS, improvements would have ecosystem-wide benefits.

In addition, a modular microkernel architecture could use reproducible builds to generate identical binaries from identical source. This would enable binary components to be certified both separately (akin to unit testing) and as an integrated system (mix and match components). This could reduce overall duplication and certification costs, even among competing commercial products derived from seL4 components.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @02:57PM (#9478109)
That's super cool, thank you for that link.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by komaromy on Saturday May 02, 2015 @09:18AM (#9476923)
There are several real-time Linux variants.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @09:43AM (#9477000)
There are - to my knowledge, feel free to correct me - no real time linux versions (or even any version of linux) that are currently certified for avionics (DO-178B certification is required for that, there are multiple levels and I don't know of any linux distro (or just the kernel) with that certification).
Re:Integer Overflow Bug in Boeing 787 Dreamliner by komaromy on Saturday May 02, 2015 @10:04AM (#9477067)
Avionics certifications are well past the extent of my knowledge and I will gladly accept your point. I was generally addressing the idea that the need for preemptive scheduling precludes the use of a Linux-like kernel.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by anderspitman on Saturday May 02, 2015 @02:53PM (#9478093)
I've never heard of anyone getting Linux running under hard real time constraints. You can get it pretty good (excellent for real time audio, for example), but can never be 100% sure you're going to meet the deadline. The people I've talked to who tried said by the time you strip out enough of the kernel to approach hard real time, you've lost enough of the advantage of using Linux that you may as well switch to an RTOS.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by jacquesm on Saturday May 02, 2015 @03:02PM (#9478129)
Real time audio only if you use a large enough buffer and a hardware component to clock the data out.

It's all about the latency guarantees and that means that you're going to have to inspect each and every path through the code for length. With the complexity of the linux kernel that's a pretty tough job and I suspect that anything lower than a few hundred milliseconds (guaranteed!) is out of the question.

I built a little controller using linux that required hard real time during a long (multiple minutes) of operation and the way I hacked it was to simply disable all interrupts and recover the various drivers as good as possible once that phase was over. It worked well but was mostly deaf to input during that time except for polling one 'stop' switch which would cause the machinery to coast down to a halt after which interrupts would be enabled.

Good enough for tinkering but I certainly would not bet anything in production on that strategy.

Real time is hard, soft real time is hard enough (without guarantees but with a best effort and a very large fraction of the deadlines satisfied), hard real time (no misses at all, guaranteed) is hard for a kernel of any complexity.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by CHY872 on Saturday May 02, 2015 @08:03AM (#9476753)
Erm, the article I got my numbers from is: http://www.aerospacelab-journal.org/sites/www.aerospacelab-j...

where it states that the airbus A380 has more than 100 million lines of code in its avionics systems.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by Dylan16807 on Saturday May 02, 2015 @08:46AM (#9476855)
3/4 of that 15M is drivers and filesystems you won't be using, and this is not including the entertainment systems.

They should be able to keep it under 10M lines pretty easily if they actually cared about bloat.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by CHY872 on Saturday May 02, 2015 @09:00AM (#9476885)
A complicating factor is that you really should include your compiler as part of your codebase (if you're doing lots of formal method work, you will usually do it on the source code, and the compiler can invalidate all of the guarantees you carefully program in), and this will be millions of lines of code (where you can't simply factor a tonne out).

Think GCC 5 is about 15 million or so now.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by oldmanjay on Saturday May 02, 2015 @12:45PM (#9477643)
it's always easy when you're not the one making the changes on the system you don't understand. is there a name for that? I feel like it's a common enough thing people do that it should have a catchy name.
Re:Integer Overflow Bug in Boeing 787 Dreamliner by Dylan16807 on Saturday May 02, 2015 @04:01PM (#9478350)
Eh. To say that something that used to be mechanical should be possible with a mere few million lines of code seems pretty obvious to me.

Or compare to the Apollo missions and the space shuttle being well under a million.

I'm not saying that it would be easy to redo the entire system from scratch now, I'm just saying that if it was a design goal from the start it wouldn't have been very onerous.

Re:Integer Overflow Bug in Boeing 787 Dreamliner by icegreentea on Saturday May 02, 2015 @09:06AM (#9476899)
Because each discrete component that you can eliminate (and replace with code) is a weight saving. Because once you tip over a point in complexity, you just keep adding more code to guard against more edge cases - edge cases you can't avoid because they involve crashing into mountains. Because you want to offload as much possible effort from the cockpit crew, while still allowing them full control over the automated feature

All of these things just add more and more code.