Tracking bad apples: reporting the origin of null and undefined value errors
Programs sometimes crash due to unusable values, for example, when Java and C# programs dereference null pointers and when C and C++ programs use undefined values to affect program behavior. A stack trace produced on such a crash identifies the effect of the unusable value, not its cause, and is oft...
Gespeichert in:
Veröffentlicht in: | OOPSLA proceedings : 22nd International Conference on Object-Oriented Programming, Systems, Languages, and Applications : Palais des congrès de Montréal, October 21-25, 2007 Systems, Languages, and Applications : Palais des congrès de Montréal, October 21-25, 2007, 2007-10, Vol.42 (10), p.405-422 |
---|---|
Hauptverfasser: | , , , , |
Format: | Artikel |
Sprache: | eng |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | Programs sometimes crash due to unusable values, for example, when Java and C# programs dereference null pointers and when C and C++ programs use undefined values to affect program behavior. A stack trace produced on such a crash identifies the effect of the unusable value, not its cause, and is often not much help to the programmer.
This paper presents efficient
origin tracking
of unusable values; it shows how to record where these values come into existence, correctly propagate them, and report them if they cause an error. The key idea is
value piggybacking
: when the original program stores an unusable value, value piggybacking instead stores origin information in the spare bits of the unusable value. Modest compiler support alters the program to propagate these modified values through operations such as assignments and comparisons. We evaluate two implementations: the first tracks null pointer origins in a JVM, and the second tracks undefined value origins in a memory-checking tool built with Valgrind. These implementations show that origin tracking via value piggybacking is fast and often useful, and in the Java case, has low enough overhead for use in a production environment. |
---|---|
ISSN: | 0362-1340 1558-1160 |
DOI: | 10.1145/1297105.1297057 |