43

While investigating Wikipedia article on Qantas Flight 72 I've found "Potential trigger types" section that says (emphasis mine):

A number of potential trigger types were investigated, including software bugs, software corruption, hardware faults, electromagnetic interference and the secondary high-energy particles generated by cosmic rays.

I wonder if there is any distinctive and ultimate difference between "bug" and "corruption" (if yes, then what is the difference) or is this just an article's wording and nothing else?

  • 3
    well, a wrong breaking condition within a recursive function (bug) is kinda different from missing a dependency in the proper version or a buggy installation process or failures on the hardware altering the binaries that comprise the system. And way more different than cosmic rays frying the whole system (software corruption). – Laiv Sep 29 at 8:09
  • 40
    There is a reference given at the Wikipedia article you cited, exactly for that paragraph. If you search the linked PDF for "corruption", you find a whole section on page 156 titled "Software corruption". They talk about a data corruption in the ROM where the software is stored. (I vote -1, since askers here on this site are expected to show some research effort on their own before they ask, don't take it personal). – Doc Brown Sep 29 at 9:16
  • 7
    Software corruption is not a standard term. The ISTQB uses the terms bug/fault/defect for the general observation that a software doesn't meet its requirements. The cause of that defect could e.g. be hardware faults, or human errors during software development. But since the referenced document defines “software corruption”, its usage seems unambiguous. – amon Sep 29 at 9:50
  • 5
    @trejder: after reading some of the answers, I removed my downvote. I think the question is good enough as it is. – Doc Brown Sep 29 at 15:47
  • 3
    N.B. the higher up in the atmosphere you go the greater chance of random memory corruption, due to increased radiation. We usually ignore it for normal computers, but on a big jet liner it becomes a real concern. – OrangeDog Sep 30 at 9:20
92

Software corruption is the contrary of software integrity. It's the same thing as data corruption, except that the data is the software code.

It can affect:

  • the software binary stored in memory: binary codes of software instructions are altered for example because of physical interference (“please switch off electronic devices during take-off and landing”), hardware defects (memory chip), malicious activities (e.g. row hammer vulnerability), or software bugs (i.e. as a consequence of a buffer overflow).
  • the software binary before it is loaded in memory, i.e. the executable file stored in a file system (e.g. SSD memory, hard disk, ...) or transiting via the network (e.g. loaded from a remote file server).
  • the software source code before the executable is produced: the source code is data like any other, that can be corrupted in the same situation as any data. A typical example is when a software company’s source code repository gets hacked (accidental cases generally prevent compilation and have a very limited impact)

Note that “software corruption” may be used ambiguously to mean corruption caused by the software instead of corruption of the software itself.

| improve this answer | |
  • 2
    Might be worth to mention that "accidental cases" don't prevent compilation in interpreted languages, and will probably just cause them to crash when run. – Erik Sep 30 at 10:00
  • 5
    @Erik You are completely right! Sorry for my compiled language bias reinforced by the aeronautic context of the question ;-) – Christophe Sep 30 at 11:10
  • 1
    Since you mention source corruption and binary storage/transmission, you may as well want to include the generation of a corrupted binary by the compiler / tool chain. – Didier L Sep 30 at 12:32
  • 1
    The best example of "software corruption" in can think of is a blog post I read a few years ago where I guy traced down this horrendously confusing error that turned out to be "cosmic ray bit-flip in the non-ECC memory backing the Linux disk cache entry for one of his binaries". I'd link it, but Google isn't being helpful. – ssokolow Oct 7 at 19:40
  • 1
    @Erik: in the general case you are right, but in this specific case I hope they don't use PHP, JavaScript or even Python in the A330's flight control software... – rob74 Oct 14 at 12:46
28

You can fix corruption by restoring from a good back up. Corruption means some of the bits somehow got changed from what they were meant to be.

You can fix a bug* by doing more development and redeploying. Here the bits are what they were meant to be. They just don’t do what we need them to do.

*Of course this assumes that bug means a defect in source code, not a moth stuck between relay contacts.

| improve this answer | |
20

A bug is when a software does exactly what the programmer told it to do, instead of what the programmer wanted it to do.

A corruption is when a software does something else than what the programmer told it to do, possibly due to hardware failure, or other problems not directly related to software development.

| improve this answer | |
  • I like this answer. Also, many times bugs are features (for hackers) and features are bugs (to an advanced user). – Tomachi Oct 7 at 4:30
15

Presumably what they mean by "software corruption" is unintended changes to the contents of an executable file due to things like a failure of the storage media.

A "bug" would mean that the binaries are the same as the originals which were provided by the software vendor or developer, but that there was some programming error which means they don't behave exactly as intended.

| improve this answer | |
  • 1
    If by originals you mean source they aren’t “the same” as binaries. Try “consistent with”. – candied_orange Sep 29 at 14:18
  • 1
    I took that to mean the installed binaries are the same as the distributed (original) binaries. – Randy Orrison Sep 29 at 22:21
  • @candied_orange In most scenarios the software vendor would supply binaries to the end user, not source code. – Jon Bentley Sep 30 at 9:01
  • @JonBentley, my view exactly. – Alex D Sep 30 at 9:11
7

I write a program, it gets compiled, sent to you, you install it on your computer. But a few bits have changed on the way. That is software corruption.

| improve this answer | |
  • 3
    Excellent! Maybe worth to add that corruption can be the result of a malicious action (e.g. row hammer or accidental (hardware defect flipping the bits, or similar electromagnetic effect). It can even be the result of a bug (buffer overflow). – Christophe Sep 29 at 12:09
5

A bug is a mistake made by a software developer.

Corruption is not a mistake by a developer; it is when something alters the program after (or during) delivery — even something accidental/benign like failing storage or network transmission error.

| improve this answer | |
2

Since 2003, the term corruption in software has also been associated with undesirable coupling between two software modules. DDD prescribes the creation of an anticorruption layer (ACL) between two software systems (or "bounded contexts" in DDD terms). If system A needs to interact with system B, and B's API uses different design standards, data structures and formats, an ACL may prevent elements of B's API to spread and "corrupt" components in A.

This use of the term "corruption" was clearly not the intent in the Qantas Flight 72 article, but it helps to clarify common terminology. Or so I hope.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.