JDK-8256311 : NPE at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: other
  • CPU: other
  • Submitted: 2020-11-06
  • Updated: 2020-12-07
  • Resolved: 2020-11-13
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
javac version 1.8.0_181

Full stacktrace: 

An exception has occurred in the compiler ((version info not available)). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1233)
	at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1628)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:393)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitReturn(Flow.java:1208)
	at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1540)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:393)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:995)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1014)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:393)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:962)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:393)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:925)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:774)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:393)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1325)
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1315)
	at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:213)
	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1389)
	at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1353)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
	at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
	at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
	at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:74)
	at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:94)
	at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:55)
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:40)
	at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkAction.execute(AbstractDaemonCompiler.java:135)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
	at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:49)
	at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:43)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
	at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:43)
	at org.gradle.workers.internal.FlatClassLoaderWorker.run(FlatClassLoaderWorker.java:32)
	at org.gradle.workers.internal.FlatClassLoaderWorker.run(FlatClassLoaderWorker.java:22)
	at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:85)
	at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:55)
	at org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:138)
	at org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
	at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:135)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)

> Task :gnd:compileDebugJavaWithJavac FAILED

A DESCRIPTION OF THE PROBLEM :
When attempting to build our project using javac version 1.8.0_181 I get the following error: 

An exception has occurred in the compiler ((version info not available)). 
java.lang.NullPointerException
	at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1233)

The build is run on the Google Cloud Platform. Build details here: https://pantheon.corp.google.com/cloud-build/builds/f87de61d-ffa3-4092-861b-2b0a1971b11c;step=3?project=ground-android-gcb

It is an Android project written in Java. We started seeing this error after making these code changes: https://github.com/google/ground-android/pull/617/files

Notably we added the ErrorProne and NullAway plugins to our project. I wonder if there's something in there which the compiler doesn't like. 

This issue looks almost identical: https://bugs.openjdk.java.net/browse/JDK-8237565

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Open a browser here: https://pantheon.corp.google.com/cloud-build/builds/f87de61d-ffa3-4092-861b-2b0a1971b11c;step=3?project=ground-android-gcb
2) Click "Retry"



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either compilation fails with useful error message or compilation succeeds.
ACTUAL -
Compiler throws NullPointerException

---------- BEGIN SOURCE ----------
https://github.com/dturner/ground-android/tree/nullaway
---------- END SOURCE ----------

FREQUENCY : always



Comments
Based on reply received from submitter closing the issue.
13-11-2020

Reply received from submitter ���========================= Just wanted to thank you for your quick response. We found a workaround by updating to openjdk13.
13-11-2020

Requested more information from the submitter ===================================== The reproducer provided by you at https://pantheon.corp.google.com/cloud-build/builds/f87de61d-ffa3-4092-861b-2b0a1971b11c;step=3?project=ground-android-gcb is not accessible for us as it redirects to google SSO. So we are not able to reproduce it. Looking at the issue, I found this issue was reported before and was fixed in JDK 15 b01. https://bugs.openjdk.java.net/browse/JDK-8235564 Please see if this fixes the issue, and revert if any more queries are there.
09-11-2020