Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in backward analysis. #3447

Closed
xingweitian opened this issue Jul 8, 2020 · 0 comments · Fixed by #3414
Closed

NullPointerException in backward analysis. #3447

xingweitian opened this issue Jul 8, 2020 · 0 comments · Fixed by #3414
Assignees

Comments

@xingweitian
Copy link
Member

Get NullPointerException when executing backward analysis:

> Task :dataflow:LiveVariablePlayground.main() FAILED
Exception in thread "main" java.lang.NullPointerException
	at org.checkerframework.dataflow.analysis.BackwardAnalysisImpl.performAnalysisBlock(BackwardAnalysisImpl.java:134)
	at org.checkerframework.dataflow.analysis.BackwardAnalysisImpl.performAnalysis(BackwardAnalysisImpl.java:86)
	at org.checkerframework.dataflow.cfg.CFGVisualizeLauncher.generateDOTofCFG(CFGVisualizeLauncher.java:145)
	at org.checkerframework.dataflow.cfg.playground.LiveVariablePlayground.main(LiveVariablePlayground.java:31)

Execution failed for task ':dataflow:LiveVariablePlayground.main()'.
> Process 'command '/opt/jdk/jdk-11/bin/java'' finished with non-zero exit value 1

A minimal test case:

public class Test {
    public void test() throws Exception {
        try {
            int[] myNumbers = {1};
            System.out.println(myNumbers[1]);
        } catch (Exception e) {}
    }
}

This issue will be fixed in #3414.

@xingweitian xingweitian self-assigned this Jul 8, 2020
smillst pushed a commit that referenced this issue Jul 23, 2020
BackwardAnalysis:
1. Add exception block's predecessor exception block to inputs (fix null pointer exception).
2. When running `runAnalysisFor()` with an exception block, pass a copied transfer input to `callTransferFunction()`.

ForwardAnalysis:
1. When running `runAnalysisFor()` with an exception block, pass a copied transfer input to `callTransferFunction()`. In the previous dataflow framework (before #3370), we passed a non-copied transfer input (https://github.com/typetools/checker-framework/pull/3370/files#diff-d4108228a0a5407e00c090c2e97d8b6dL401-L402). This seems a bug existing in the old dataflow framework.

Resolves #3447.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant