News for hackers. Stuff that matters.
Re:A400M Airbus Flier crashed because of software issues by castell on Tuesday May 19, 2015 @09:06AM (#9569709)
Which programming language is commonly used there? Ada, C, C++, JOVIAL, Asm?
Re:A400M Airbus Flier crashed because of software issues by shepardrtc on Tuesday May 19, 2015 @10:57AM (#9570489)
Nowadays, its C/C++. In the past it was Ada (at least in the US). Ada was created specifically for this sort of thing (and was actually a requirement for certain projects), but it never gained popularity so companies would just petition the government to use C/C++ instead. Its a shame, too. Ada is fantastic if you want to avoid bugs. I wish more people would give it a chance.

On the other hand, I also wonder why people don't think of using Erlang for something like this. The VM is designed for a ridiculous amount of uptime, it has a supervisor tree that can monitor and restart failed processes, and it can interface with C/C++. A rock-solid VM should be running and monitoring life-safety systems.

Re:A400M Airbus Flier crashed because of software issues by Jtsummers on Tuesday May 19, 2015 @11:57AM (#9571053)
Erlang's model is entirely appropriate, but the language and VM aren't. This code is often running on small embedded chips (so you'd need to port the VM) and the software has hard real-time requirements, which the Erlang VM is not (currently) set up to handle, nor would it necessarily be able to achieve on the commonly used processors. Another strike against the language (as much as I love it) is that it's dynamically typed. That's less appropriate for this sort of software. There are static analysis tools for Erlang that mitigate this, but it's still an issue. Large classes of bugs and errors can be eliminated or minimized with statically typed languages or with static analysis tools if they're well integrated into the build process. A real-time, statically typed language with Erlang's semantics and compiled to native binaries would be a boon, however.

I'll speak to the 787 avionics system. It used a system of channels/buffers and processes very much like what Erlang and Go use for interprocess communication (I'm trying to remember now if channels could be received in multiple processes like Go or if only a single process could receive like in Erlang). This was an excellent model for what we were doing, and really for a lot of systems this sort of CSP and actor style model maps well.

Re:A400M Airbus Flier crashed because of software issues by tormeh on Tuesday May 19, 2015 @11:38AM (#9570903)
Using C/C++ on these projects is idiotic. If Airbus used C/C++ then they deserve all the financial loss in the world. They have blood on their hands.
Re:A400M Airbus Flier crashed because of software issues by lambdaelite on Tuesday May 19, 2015 @12:07PM (#9571136)
Keep in mind they don't use C/C++. They use C/C++ with a coding standard (like MISRA), static analysis tools, validated compilers, development processes incorporating change control, documentation, verification and validation, etc.

What alternative are you suggesting?

Re:A400M Airbus Flier crashed because of software issues by progman on Tuesday May 19, 2015 @01:20PM (#9571632)
I know that Ada compilers are 100% verified correct but is there really any validated C++ compiler? Which one?

AFAIK (partial) assurance in C/C++ can only be handled by additional testing tools, Frama-C for instance.

I agree that C/C++ should not be used for security applications. Ada is a much better choice because it was designed for security.

Re:A400M Airbus Flier crashed because of software issues by lambdaelite on Tuesday May 19, 2015 @01:36PM (#9571758)
Not sure if I'm understanding your question correctly, but Wind River claims their Diab compiler is validated by TÜV NORD and is has been used for stuff up to SIL4.

In fact, they (http://windriver.com/products/product-overviews/PO_Diab_Comp...) say:

  Diab Compiler has been a reliable code generation tool for
  avionics products certified for DO-178B, products for the
  nuclear market certified to IEC 60880, railway applications
  certified to EN 50128, and industrial products certified
  to IEC 61508, and is now qualified for use in automotive
  applications certified to ISO 26262.
Ada does have some built-in advantages, but I think my point still stands: the language is a small part of the entire SDLC, and I don't think it's the most important part.
Re:A400M Airbus Flier crashed because of software issues by castell on Wednesday May 20, 2015 @08:14AM (#9575772)
Is TÜV Nord/Sued known for extensive software checking?
Re:A400M Airbus Flier crashed because of software issues by CHY872 on Tuesday May 19, 2015 @04:06PM (#9572759)
Are you sure that Ada compilers are verified correct?

I'm pretty sure that the only industrial formally verified compiler is CompCert (for C), though I could be wrong. The motivation for CompCert was certainly that Airbus wanted such a compiler.

Ada wouldn't be a better choice simply because it's designed for security. It'd be a better choice if it turned out better in practice. I've read some of the studies that have been done, and I haven't found them convincing.

Requiring additional tools just isn't a problem, if it works well. Don't criticise the process, criticise the result.

Re:A400M Airbus Flier crashed because of software issues by tormeh on Tuesday May 19, 2015 @01:46PM (#9571834)
Ada, of course. Are you saying it wasn't at the forefront of your mind? If I sound patronizing it's because I am.
Re:A400M Airbus Flier crashed because of software issues by lambdaelite on Tuesday May 19, 2015 @02:13PM (#9572015)
As I said elsewhere, Ada does have some very nice built-in advantages, but I think my point stands: the language is a small part of the entire SDLC, and I don't think it's the most important part.

The focus on languages instead of the SDLC is telling, I think.

Re:A400M Airbus Flier crashed because of software issues by jcadam on Tuesday May 19, 2015 @12:32PM (#9571293)
Really, you'd want to use Ada for something like this (The language has survived specifically because it's managed to carve out a niche for itself in aerospace).

I once worked on satellite systems using Ada95 and Ada2005 (Ada is definitely not dead). The language is a pain to use but is impressive in that it catches more crap at compile-time than anything else I've seen.

Re:A400M Airbus Flier crashed because of software issues by progman on Tuesday May 19, 2015 @01:22PM (#9571656)
> Ada is definitely not dead

True. More information: http://www.ada2012.org

Re:A400M Airbus Flier crashed because of software issues by lamby on Tuesday May 19, 2015 @09:17AM (#9569783)
With that kind of coding-to-testing-and-documentation ratio, does it even matter?
Re:A400M Airbus Flier crashed because of software issues by TheLoneWolfling on Tuesday May 19, 2015 @10:47AM (#9570409)
Yes, definitely.

For a quick example, there are many languages where you cannot accidentally run off the end/start of an array, barring a compiler error.

With a language like C / C++, it's possible. Not probable, given that sort of testing. But possible nonetheless.

Some languages are also easier to test than others, partially because of this, partially because of other issues. For instance, in some languages you can guarantee at the language level (again, barring compiler errors) that something won't be modified. (Like const, but actually working.)

Re:A400M Airbus Flier crashed because of software issues by gsnedders on Tuesday May 19, 2015 @07:40PM (#9573842)
Yes. The more the type-system encodes the more the type-checker (in the compiler) proves for you. No matter how much testing you have, nothing will ever come close to proving properties.
Re:A400M Airbus Flier crashed because of software issues by UnoriginalGuy on Tuesday May 19, 2015 @09:34AM (#9569885)
Yes. Some languages are better at scoping than others. Functional languages are easier to test because they have more confined scope.
Re:A400M Airbus Flier crashed because of software issues by tjbiddle on Tuesday May 19, 2015 @09:33AM (#9569879)
Then to add to it, what are tests written in?