Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8273234

extended 'for' with expression of type tvar causes the compiler to crash

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      17
    • Resolved In Build:
      b14
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        x86-64 / Ubuntu 21.04 / JDK 17 RC

        A DESCRIPTION OF THE PROBLEM :
        When building the Ghidra project (https://github.com/NationalSecurityAgency/ghidra) with JDK 17, I am getting a compiler exception in the :SoftwareModeling:compileJava gradle task. Unfortunately the stack trace does not provide me with enough information to track down the issue to a specific task.

        REGRESSION : Last worked in version 16.0.2

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Follow the build instructions at https://github.com/NationalSecurityAgency/ghidra/blob/master/README.md#build using the latest JDK 17 and Gradle 7 instead of the suggested versions.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The gradle buildGhidra task should succeeded without error as it did for JDK 16.
        ACTUAL -
        > Task :SoftwareModeling:compileJava
        Note: Some input files use or override a deprecated API.
        Note: Recompile with -Xlint:deprecation for details.
        Note: Some input files use or override a deprecated API that is marked for removal.
        Note: Recompile with -Xlint:removal for details.
        An exception has occurred in the compiler (17). 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, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
        java.lang.AssertionError: isSubClass P
                at jdk.compiler/com.sun.tools.javac.code.Symbol.isSubClass(Symbol.java:546)
                at jdk.compiler/com.sun.tools.javac.code.Symbol.isMemberOf(Symbol.java:555)
                at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.overrides(Symbol.java:2092)
                at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.overrides(Symbol.java:2052)
                at jdk.compiler/com.sun.tools.javac.code.Types$ImplementationCache.implementationInternal(Types.java:2984)
                at jdk.compiler/com.sun.tools.javac.code.Types$ImplementationCache.get(Types.java:2969)
                at jdk.compiler/com.sun.tools.javac.code.Types.implementation(Types.java:3004)
                at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:2159)
                at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:2152)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.notOverriddenIn(Resolve.java:471)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1572)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1788)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1879)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1832)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve$11.doLookup(Resolve.java:2737)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3454)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3704)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2734)
                at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveInternalMethod(Resolve.java:2828)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.visitForeachLoop(Attr.java:1545)
                at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1231)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:674)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:748)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:767)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1445)
                at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:674)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:748)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1235)
                at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:674)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:748)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5474)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5365)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5217)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5196)
                at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5141)
                at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1317)
                at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
                at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
                at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
                at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
                at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
                at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:89)
                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:54)
                at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39)
                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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:568)
                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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
                at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
                at java.base/java.lang.Thread.run(Thread.java:833)

        > Task :SoftwareModeling:compileJava FAILED

        FAILURE: Build failed with an exception.


        CUSTOMER SUBMITTED WORKAROUND :
        Continue to use JDK 11-16.

        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: