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

Crash when trying to use latest snapshot version of Checker dataflow #6327

Closed
msridhar opened this issue Nov 30, 2023 · 1 comment · Fixed by #6329
Closed

Crash when trying to use latest snapshot version of Checker dataflow #6327

msridhar opened this issue Nov 30, 2023 · 1 comment · Fixed by #6329
Assignees
Labels

Comments

@msridhar
Copy link
Contributor

To reproduce, do ./gradlew publishToMavenLocal in the Checker Framework repo, then check out https://github.com/msridhar/NullAway/tree/cf-3.40.1-snapshot, and finally run ./gradlew :sample:compileJava in the NullAway repo. I get a crash (this is with JDK 17), relevant stack:

 Caused by: org.checkerframework.nullaway.javacutil.UserError: Configuration problem! Could not load type: org.checkerframework.dataflow.qual.AssertMethod
        at org.checkerframework.nullaway.javacutil.TreeUtils.getMethods(TreeUtils.java:1332)
        at org.checkerframework.nullaway.javacutil.TreeUtils.getMethod(TreeUtils.java:1276)
        at org.checkerframework.nullaway.javacutil.TreeUtils.getMethod(TreeUtils.java:1257)
        at org.checkerframework.nullaway.dataflow.cfg.builder.CFGTranslationPhaseOne.<init>(CFGTranslationPhaseOne.java:462)
        at com.uber.nullaway.dataflow.cfg.NullAwayCFGBuilder$NullAwayCFGTranslationPhaseOne.<init>(NullAwayCFGBuilder.java:112)
        at com.uber.nullaway.dataflow.cfg.NullAwayCFGBuilder.build(NullAwayCFGBuilder.java:70)
        at com.uber.nullaway.dataflow.DataFlow$2.load(DataFlow.java:137)
        at com.uber.nullaway.dataflow.DataFlow$2.load(DataFlow.java:102)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3571)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2313)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2190)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2080)

This looks like the relevant code:

assertMethodValueElement = TreeUtils.getMethod(AssertMethod.class, "value", 0, env);
assertMethodParameterElement = TreeUtils.getMethod(AssertMethod.class, "parameter", 0, env);
assertMethodIsAssertFalseElement =
TreeUtils.getMethod(AssertMethod.class, "isAssertFalse", 0, env);

Will this code only work if the checker-qual artifact is in the classpath of the program being compiled? If so, can we do things in a different way that removes that requirement? This requirement won't work for NullAway users.

@msridhar
Copy link
Contributor Author

FYI @smillst

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

Successfully merging a pull request may close this issue.

2 participants