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

Groovy fails to pass tests with invokedynamic activated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 7u60
    • Fix Version/s: 7u60
    • Component/s: hotspot

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0_60-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_60-ea-b04)
      Java HotSpot(TM) 64-Bit Server VM (build 24.60-b07, mixed mode)


      FULL OS VERSION :
      Linux Ubuntu-1310-saucy-64-minimal 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      The Groovy language build fails to pass with JDK 7u60 b04 when invokedynamic is activated. We have 23 failing tests (http://ci.groovy-lang.org/viewLog.html?buildId=410&tab=buildResultsDiv&buildTypeId=Groovy_Jdk7snapshotBuild), all of them failing with a similar error:

      java.lang.IllegalArgumentException: target and fallback types must match: (Object,Object,Object,Object,Object,Object,Object,Object,Object)Object != (HelpFormatter,PrintWriter,int,String,String,Options,Object,Object,String)Object

      It is very important to note that Groovy doesn't build with JDK 7 since u40. u11 is the latest version which passes successfully all tests. u25 had a serious bug (infinite loop) with classloaders and u40+ are all buggy.

      We also run the build against JDK8 (built from sources) and *everything passes* so it's really a JDK7 specific issue.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

      REGRESSION. Last worked in version 7u11

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      git clone git@github.com:groovy/groovy-core.git
      cd groovy-core
      export JAVA_HOME=/path/to/jdk7u60b04
      ./gradlew -Pindy=true test


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The build should pass.
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.IllegalArgumentException: target and fallback types must match: (Object,Object,Object,Object,Object,Object,Object,Object,Object,Object)Object != (TypeCheckingExtensionsTest,String,String,String,String,String,String,String,String,String)Object
          at java.lang.invoke.MethodHandleStatics.newIllegalArgumentException(MethodHandleStatics.java:113)
          at java.lang.invoke.MethodHandles.misMatchedTypes(MethodHandles.java:2198)
          at java.lang.invoke.MethodHandles.guardWithTest(MethodHandles.java:2182)
          at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setGuards(Selector.java:706)
          at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setCallSiteTarget(Selector.java:820)
          at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:208)
          at groovy.transform.stc.TypeCheckingExtensionsTest.testNthArgMatches(TypeCheckingExtensionsTest.groovy:293)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at junit.framework.TestCase.runTest(TestCase.java:176)
          at junit.framework.TestCase.runBare(TestCase.java:141)
          at junit.framework.TestResult$1.protect(TestResult.java:122)
          at junit.framework.TestResult.runProtected(TestResult.java:142)
          at junit.framework.TestResult.run(TestResult.java:125)
          at junit.framework.TestCase.run(TestCase.java:129)
          at junit.framework.TestSuite.runTest(TestSuite.java:255)
          at junit.framework.TestSuite.run(TestSuite.java:250)
          at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
          at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
          at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
          at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
          at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
          at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
          at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
          at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
          at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
          at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
          at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
          at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
          at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:744)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Use 7u11, the only known version of JDK7 which works properly with Groovy and invokedynamic.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              twisti Christian Thalinger
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: