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
andThrowable
and also callsabort
orSystem.exit
(also looking forhalt
, 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
, orthrow
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
- Install codeql
- Download source code to analyze (or, directly download the QL database from lgtm.com)
./runQuery path_to_source projname findErrorCatch.ql
- Output will be
projname_temp.csv