/DStatic-error-tracking

QL re-implementation of Aspirator (OSDI 2014) static analysis for catch clause error tracking in Java distributed systems

Primary LanguageCodeQL

DStatic-error-tracking

QL re-implementation of the simple static analysis for identifying error-causing catch clauses presented as Aspirator in OSDI 2014.

Specifically, it flags catch clauses if:

  • catch block is empty or just contains a logging statement
  • catch block contains TODO or FIXME in the comments
  • catch catches a higher level exception like Exception and Throwable and also calls abort or System.exit (also looking for halt, although this was not in the original paper)

And, it does not flag empty catch clauses if:

  • catch block has a corresponding try that modifies the value of a local variable and that variable is checked in the basic block after the catch
  • catch block has a corresponding try that has return, continue, or throw as the last statement and the basic block after the catch is not empty

Tested with

Tested with a subset of the projects over which the original authors tested Aspirator. Specifically:

Usage

  1. Install codeql
  2. Download source code to analyze (or, directly download the QL database from lgtm.com)
  3. ./runQuery path_to_source projname findErrorCatch.ql
  4. Output will be projname_temp.csv