Integrating support for undo with exception handling

One of the important tasks of exception handling is to restore program state and invariants. Studies suggest that this is often done incorrectly. We introduce a new language construct that integrates automated memory recovery with exception handling. When an exception occurs, memory can be automatically restored to its previous state. We also provide a mechanism for applications to extend the automatic recovery mechanism with callbacks for restoring the state of external resources. We describe a logging-based implementation and evaluate its effect on performance. The implementation imposes no overhead on parts of the code that do not make use of this feature.

[1]  John B. Goodenough,et al.  Exception handling: issues and a proposed notation , 1975, CACM.

[2]  Erik Ruf,et al.  Marmot: an optimizing compiler for Java , 2000 .

[3]  P. M. Melliar-Smith,et al.  Software reliability: The role of programmed exception handling , 1977, Language Design for Reliable Software.

[4]  Erik Ruf,et al.  Marmot: an optimizing compiler for Java , 2000, Softw. Pract. Exp..

[5]  John C. Gyllenhaal,et al.  Java bytecode to native code translation: the Caffeine prototype and preliminary results , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[6]  J. Gregory Morrisett,et al.  Composing first-class transactions , 1994, TOPL.

[7]  Barbara Liskov,et al.  Aspects Of Implementing CLU , 1978, ACM Annual Conference.

[8]  Tim Harris Design choices for language-based transactions , 2003 .

[9]  Flaviu Cristian A Recovery Mechanism for Modular Software , 1979, ICSE.

[10]  Christof Fetzer,et al.  Automatic detection and masking of nonatomic exception handling , 2003, IEEE Transactions on Software Engineering.

[11]  P. M. Melliar-Smith,et al.  A program structure for error detection and recovery , 1974, Symposium on Operating Systems.

[12]  Keir Fraser,et al.  Language support for lightweight transactions , 2003, SIGP.

[13]  John C. Gyllenhaal,et al.  Optimizing NET Compilers for Improved Java Performance , 1997, Computer.

[14]  Timothy L. Harris,et al.  Exceptions and side-effects in atomic blocks , 2005, Sci. Comput. Program..

[15]  Barbara Liskov,et al.  Guardians and Actions: Linguistic Support for Robust, Distributed Programs , 1983, TOPL.

[16]  George C. Necula,et al.  Finding and preventing run-time error handling mistakes , 2004, OOPSLA.