A software bug is a problem with the code in a computer program which makes it not work properly. They can cause inconvenience to the user and may make their computer crash or freeze. Most computer programs have bugs. A program that has a large number of bugs (or possibly a single or a few serious bugs) is said to be buggy.
Most bugs are caused by bad programming by the developer, but sometimes they can be caused by compiler problems. When bugs are found, people send bug reports to the developer to tell them about the bug and let them fix it.
Some bugs are harmless, for example, many video games incorrectly allow objects to move through walls. Other bugs are more severe, for example, a bug in a navigation system that causes an airplane to explode, or the two bugs in the Therac-25 radiation therapy machine's control software, which caused it to produce far more radiation than intended, killing at least three people.
Types of bugsEdit
A buffer overflow happens when a program writes to or reads from an area of memory that it is not supposed to access.
An arithmetic overflow happens when a number contained in a variable is increased beyond the highest number that the variable allows. This will usually cause the number to reset back to zero.
An infinite loop happens when a program enters a loop (a series of instructions that is repeated many times) and there is no way out of the loop. This can cause the program to freeze.
If a floating point variable doesn't have enough precision, the number stored in it can be inaccurate. This can cause various problems depending on the type of program, for example it could cause a navigation program to navigate to an unintended location, or distorted sound in an audio recording program.
Division by zeroEdit
Division by zero is an invalid math operation. If a program divides an integer by zero, it will crash. On Linux, the message displayed when this bug occurs is "floating point exception", even though floating point numbers were not involved. Floating point math sometimes allows division by zero. This will usually result in a special "not a number" value.
In video games, clipping problems, also called collision detection problems, occur when an object passes through a barrier (such as a wall, floor, or ceiling) that it was not intended to pass through. This is a very common bug found throughout many video games. This can happen, for example, in Doom 2 when a crushed monster is resurrected by an arch-vile. Clipping problems can often be used as a time-saving tactic in speedruns, for example, in Super Mario 64 it is possible to skip walking up the spiral staircase in the castle by jumping through the ceiling.
Security bugs are bugs that allow an intruder to either gain access to the computer, or cause the computer to crash. Causing the computer to crash is called a denial-of-Service attack. Security bugs are considered especially important to fix because they might allow intruders to steal important information such as credit card numbers or passwords. Examples of security bugs include Heartbleed and Shellshock.
A misbug is a bug that has been used as a feature. An example would be a bug in an Android phone that allows users to gain root access.
Some bugs affect hardware (the physical parts of a computer) instead of software. For example, running the instruction
lock cmpxchg8b eax on old Pentium processors would cause the processor to stop working until rebooted. Since hardware bugs are physical design flaws, they can not be corrected with a software update, although it may be possible to work around (hide) the bug with a software update, for example, by checking for the conditions that cause the bug or by rearranging data in a way that prevents the bug from occurring.
- Software bug -Citizendium