A problem that causes a program to produce invalid output or to crash (lock up). The problem is commonly erroneous logic that misdirects the computer to a place in the program where an instruction does not exist, and the computer will halt at that point.
Insufficient Logic Also Produces Bugs
For example, if there are not enough validity checks performed on the input or on the calculations themselves, a buffer overflow or a divide-by-zero may occur (see
buffer overflow or
divide overflow).
Bad Logic Equals Bad Output But No Crash
If a program is supposed to add an amount, but subtracts it instead, invalid output is produced but the computer keeps running. This is why extensive testing is required. See
abend,
bug and
buggy.