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

Error Prone integration: NSME during ReferenceEquality pattern check #5989

Closed
davido opened this issue Aug 26, 2018 · 2 comments
Closed

Error Prone integration: NSME during ReferenceEquality pattern check #5989

davido opened this issue Aug 26, 2018 · 2 comments
Assignees
Labels
team-Rules-Java Issues for Java rules untriaged

Comments

@davido
Copy link
Contributor

davido commented Aug 26, 2018

On most recent Bazel version (398478c) with activated ReferenceEquality, Bazel crashes:

$ bazel build --java_toolchain //tools:error_prone_warnings_toolchain //java/com/google/gerrit/server:server 
DEBUG: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/bazel_skylib/lib/versions.bzl:98:7: 
Current Bazel is not a release version, cannot check for compatibility.
DEBUG: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/bazel_skylib/lib/versions.bzl:99:7: Make sure that you are running at least Bazel 0.14.0.
INFO: Analysed target //java/com/google/gerrit/server:server (1 packages loaded).
INFO: Found 1 target...
INFO: From Building external/com_google_protobuf/libprotobuf_java.jar (77 source files, 1 source jar):
warning: [options] source value 6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
ERROR: /home/davido/projects/gerrit2/java/com/google/gerrit/server/BUILD:21:1: Building java/com/google/gerrit/server/libserver-class.jar (965 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor) failed (Exit 1)
java/com/google/gerrit/server/notedb/ReviewerStateInternal.java:53: warning: [ImmutableEnumChecker] enums should be immutable: 'ReviewerStateInternal' has field 'footerKey' of type 'org.eclipse.jgit.revwalk.FooterKey', the declaration of type 'org.eclipse.jgit.revwalk.FooterKey' is not annotated with @com.google.errorprone.annotations.Immutable
  private final FooterKey footerKey;
                          ^
    (see https://errorprone.info/bugpattern/ImmutableEnumChecker)
java/com/google/gerrit/server/index/change/ChangeIndexRewriter.java:158: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
    if (in == out || out instanceof IndexPredicate) {
           ^
     Please report this at https://github.com/google/error-prone/issues/new and include the following:
  
     error-prone version: 2.3.2-SNAPSHOT
     BugPattern: ReferenceEquality
     Stack Trace:
     com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: org.checkerframework.dataflow.cfg.CFGBuilder.build(Lcom/sun/source/tree/CompilationUnitTree;Lorg/checkerframework/dataflow/cfg/UnderlyingAST;ZZLjavax/annotation/processing/ProcessingEnvironment;)Lorg/checkerframework/dataflow/cfg/ControlFlowGraph;
  	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2048)
  	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
  	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3973)
  	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4957)
  	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4963)
  	at com.google.errorprone.dataflow.DataFlow.methodDataflow(DataFlow.java:167)
  	at com.google.errorprone.dataflow.DataFlow.expressionDataflow(DataFlow.java:226)
  	at com.google.errorprone.dataflow.nullnesspropagation.NullnessAnalysis.getNullness(NullnessAnalysis.java:59)
  	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.getNullness(AbstractReferenceEquality.java:186)
  	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.addFixes(AbstractReferenceEquality.java:107)
  	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.matchBinary(AbstractReferenceEquality.java:82)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:507)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1999)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitBinary(TreeScanner.java:624)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:513)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1999)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitParenthesized(TreeScanner.java:572)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitParenthesized(ErrorProneScanner.java:989)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitParenthesized(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCParens.accept(JCTree.java:1855)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:418)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:756)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1433)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:528)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:206)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:896)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:588)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
  	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
  	at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:603)
  	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:146)
  	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
  	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
  	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:64)
  	at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
  	at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152)
  	at com.google.devtools.build.buildjar.javac.plugins.errorprone.ErrorPronePlugin.postFlow(ErrorPronePlugin.java:111)
  	at com.google.devtools.build.buildjar.javac.BlazeJavaCompiler.flow(BlazeJavaCompiler.java:112)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1367)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:965)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
  	at com.google.devtools.build.buildjar.javac.BlazeJavacMain.compile(BlazeJavacMain.java:111)
  	at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder$2.invokeJavac(SimpleJavaLibraryBuilder.java:122)
  	at com.google.devtools.build.buildjar.ReducedClasspathJavaLibraryBuilder.compileSources(ReducedClasspathJavaLibraryBuilder.java:54)
  	at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.compileJavaLibrary(SimpleJavaLibraryBuilder.java:125)
  	at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.run(SimpleJavaLibraryBuilder.java:133)
  	at com.google.devtools.build.buildjar.BazelJavaBuilder.processRequest(BazelJavaBuilder.java:105)
  	at com.google.devtools.build.buildjar.BazelJavaBuilder.runPersistentWorker(BazelJavaBuilder.java:67)
  	at com.google.devtools.build.buildjar.BazelJavaBuilder.main(BazelJavaBuilder.java:45)
  Caused by: java.lang.NoSuchMethodError: org.checkerframework.dataflow.cfg.CFGBuilder.build(Lcom/sun/source/tree/CompilationUnitTree;Lorg/checkerframework/dataflow/cfg/UnderlyingAST;ZZLjavax/annotation/processing/ProcessingEnvironment;)Lorg/checkerframework/dataflow/cfg/ControlFlowGraph;
  	at com.google.errorprone.dataflow.DataFlow$2.load(DataFlow.java:120)
  	at com.google.errorprone.dataflow.DataFlow$2.load(DataFlow.java:94)
  	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
  	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2276)
  	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
  	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
  	... 90 more
Target //java/com/google/gerrit/server:server failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.365s, Critical Path: 4.82s
INFO: 13 processes: 13 remote cache hit.
FAILED: Build did NOT complete successfully

Reproducer: [1], [2].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/194045
[2] https://git.eclipse.org/r/128082

davido added a commit to davido/bazel that referenced this issue Aug 26, 2018
Fixes bazelbuild#5989.

In 9e18b2c error prone was bumped, but transitive dependencies were
missed to be updated as well. This was done in this CL upstream: [1].

* [1] google/error-prone@e526aa1
cushon added a commit to cushon/bazel that referenced this issue Aug 26, 2018
@cushon cushon self-assigned this Aug 26, 2018
@cushon
Copy link
Contributor

cushon commented Aug 26, 2018

Er, I saw the issue subject and didn't notice you also opened a PR for it. Thanks!

I'll get the fix merged next week.

@davido
Copy link
Contributor Author

davido commented Aug 26, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-Java Issues for Java rules untriaged
Projects
None yet
Development

No branches or pull requests

3 participants