NPEFix: Automatic Runtime Repair of Null Pointer Exceptions in Java

Null pointer exceptions, also known as null dereferences are the number one exceptions in the field. In this paper, we propose 9 alternative execution semantics when a null pointer exception is about to happen. We implement those alternative execution strategies using code transformation in a tool called NPEfix. We evaluate our prototype implementation on 11 field null dereference bugs and 519 seeded failures and show that NPEfix is able to repair at runtime 10/11 and 318/519 failures.

[1]  Susan Horwitz,et al.  Protecting C programs from attacks via invalid pointer dereferences , 2003, ESEC/FSE-11.

[2]  William Pugh,et al.  Null dereference analysis in practice , 2010, PASTE '10.

[3]  Westley Weimer,et al.  Changing Java's Semantics for Handling Null Pointer Exceptions , 2008, 2008 19th International Symposium on Software Reliability Engineering (ISSRE).

[4]  Greg Kroah-Hartman,et al.  Linux Device Drivers , 1998 .

[5]  David Hovemeyer,et al.  Evaluating and tuning a static analysis to find null pointer bugs , 2005, PASTE '05.

[6]  Fausto Spoto Precise null-pointer analysis , 2009, Software & Systems Modeling.

[7]  Xuxian Jiang,et al.  AutoPaG: towards automated software patch generation with source code root cause identification and repair , 2007, ASIACCS '07.

[8]  Shujuan Jiang,et al.  Fault localization and repair for Java runtime exceptions , 2009, ISSTA.

[9]  Shinji Kusumoto,et al.  Does return null matter? , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[10]  Rajiv Gupta,et al.  Execution suppression: An automated iterative technique for locating memory errors , 2010, TOPL.

[11]  Angelos D. Keromytis,et al.  ASSURE: automatic software self-healing using rescue points , 2009, ASPLOS.

[12]  Stephen W. Kent Dynamic Error Remediation : A Case Study with Null Pointer Exceptions , 2008 .

[13]  Earl T. Barr,et al.  Casper: Debugging Null Dereferences with Ghosts and Causality Traces , 2015 .

[14]  Michael D. Bond,et al.  Tracking bad apples: reporting the origin of null and undefined value errors , 2007, OOPSLA.

[15]  Giuliano Antoniol,et al.  An Approach for Search Based Testing of Null Pointer Exceptions , 2011, 2011 Fourth IEEE International Conference on Software Testing, Verification and Validation.

[16]  Yuanyuan Zhou,et al.  Have things changed now?: an empirical study of bug characteristics in modern open source software , 2006, ASID '06.

[17]  Fan Long,et al.  Automatic runtime error repair and containment via recovery shepherding , 2014, PLDI.