Runtime error

from Wikipedia, the free encyclopedia

Runtime errors ( english runtime error ) are in the information technology errors occurring during the term of a computer program may occur.

Run-time errors lead to the crash of the running program, incorrect results, or unpredictable behavior of the program. The causes for this can be very different; for example, when variables are overwritten or filled with incorrect / inconsistent data - which lead to errors in subsequent commands.

Limitation: Not as runtime errors are bugs that during the development of the program code , for example. B. by development tools such as the compiler . If these are serious, for example gross, syntax errors , usually no executable code is generated and the program can therefore not be executed.

Deviating meanings: In the literature, there are also descriptions of the term "runtime error" that differ in details:

  • So apply z. B. after or only program errors as runtime errors - which, from this point of view, are one of the possible classifications for program errors. According to other sources, runtime errors can also have other causes , e.g. B. after or ("or as a result of external effects").
  • Furthermore, runtime errors are sometimes always equated with termination , while other authors also refer to logical errors that occur during runtime without termination as runtime errors .
  • According to the source, a 'runtime error' only occurs during runtime i. S. from productive operation to ("... and [was] not recognized during program development").

According to the guide defect classification software of BITKOM , the occurrence counts of runtime errors on the errors of Class A ( "very serious mistakes, the application can not run ...").

One way of preventing runtime errors is to prevent sources of error, for example through a field check and typing . Some programming languages ​​also provide the option of handling runtime errors as exceptional situations in order to be able to react sensibly to unforeseen events.

Fault identification

In many system environments, runtime errors are identified with numbers for unambiguous designation - and as references to relevant user documentation , e.g. B. runtime error 13 (types incompatible ...), runtime error 3190 (too many fields defined). Such numbering is also often used as a reference for queries in Internet chats.

When a runtime error occurs, the operating system usually creates a memory dump from which a software developer can usually identify more detailed information about the error and its cause.

Typical examples

Most of the errors described below would already be detected in the software test if the scope of the test was appropriate and would no longer appear as runtime errors after the program was cleaned up :

  • Use of object references that previously did not refer to an object , but to "nothing" (e.g. null pointer in C )
  • Incorrect memory allocation - occurs especially in programming languages ​​that do not perform automatic garbage collection, such as C.
  • missing files from which the program should obtain data.
  • Trying to read records past the end of the file.
  • Division by zero .
  • Server is not available or does not respond after the maximum allotted waiting time
  • a stack overflow , this typically occurs when a recursive function is called too often in a nested manner; there is usually an endless recursion that occurs due to a logic error.
  • Errors in the technical program logic such as endless loops due to end conditions never occurring, incorrect data formats, e.g. B. because not initialized, index overflow or underflow, missing but required parameters , etc.
  • Depending on the definition (for example with), 'runtime errors' are all errors that occur during program runtime, even if they do not lead to the program being terminated. They can result from any type of incorrect implementation of program functionality - such as incorrect formulas or program logic; Processing of incorrect, unchecked input data; Plus instead of minus; greater than greater than / equal to; wrong (but existing) field names addressed; Dot-before-line rule ignored.

Changes to the system environment , e.g. B. the hardware , if they are not taken into account in the software, cause runtime errors, for example:

  • Attempted database access, but the database server has failed
  • An attempt to save data on removable storage media fails because someone has removed the media from the drive or because the storage medium is write-protected.
  • In the case of distributed applications in which several computers are running parts of the same program at the same time, one of the computers may have failed. This means that the rest of the program is missing calculation results.

Meaning and consequences

Corresponding to the variety of causes for runtime errors, the bandwidth with regard to the significance and consequences of runtime errors can be very large. The following aspects, for example, are decisive for this:

In which system environment does the error occur?

A runtime error during the software test applies e.g. B. in debug mode as the normal case or it can be brought about intentionally, for example to test exception handling . In productive operation , on the other hand, it is usually always an undesirable, possibly critical event that can lead to considerable disruptions; see also program error consequences . Runtime errors also differ in terms of their consequences depending on whether they occur in a private computer environment (e.g. in a computer game ) or in a highly sensitive corporate environment.

Detection / elimination of the runtime error / elimination time

Some runtime errors can, depending on their type, be recognized and corrected very quickly. Example: If an output file was not defined in the execution specifications ( JCL etc.). In other cases, a software developer may have to be called in to analyze the error. If a new version of the software has to be provided for troubleshooting, this requires extensive administrative measures depending on the situation . In time-critical applications, rapid analysis and rectification are of great importance in order to avoid problems / damage in the processes supported by the application.

(Partial) results already generated

If results were already generated at the time of the runtime error, processing must be continued at exactly a certain point in the program after the error has been corrected, or the effect of the results (e.g. in the event of changes in databases ) must be (can) be reset; see also rollback .

Individual evidence

  1. ^ Duden Informatik, ISBN 3-411-05232-5 .
  2. a b Software Developer Wiki [1]
  3. Uni Hagen [2] (PDF; 1.2 MB) Bertschler master's thesis
  4. University of Oldenburg [3]
  5. BCS Glossary of Computing and ICT [4]
  6. dickbaldwin alice [5]
  7. a b Cay Horstmann [6] JAVA for everyone
  8. IT knowledge [7]
  9. Defect Classification for Software - Guide. (PDF; 568 KB) BITKOM , 2008, accessed on October 13, 2018 (guide to error classification ).