Unexpected compilation error with 2.4.14

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Unexpected compilation error with 2.4.14

Andres Almiray
Hello everyone,

I'm in the process of updating the Griffon build to use Groovy 2.4.14 and encountered a weird problem in one of the tests https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

The test runs fine with 2.413 but generates the following stacktrace with 2.4.14

java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
	at java.lang.Class.getConstructor0(Class.java:3075)
	at java.lang.Class.getConstructor(Class.java:1825)
	at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
	at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
	at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
	at groovy.lang.MetaClassImpl.createStaticSite(MetaClassImpl.java:3421)
	at groovy.lang.ExpandoMetaClass.createStaticSite(ExpandoMetaClass.java:1308)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:76)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:161)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
	at griffon.javafx.GriffonFXCollectionsExtensionTest.testOperationsWithObservable(GriffonFXCollectionsExtensionTest.groovy:78)
	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:116)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:59)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:39)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	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:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
	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:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	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:55)
	at java.lang.Thread.run(Thread.java:748)

The "faulty" line is

Function<Integer, Integer> function = Function.identity()

I'm baffled by this error as java.util.function.Function is a core JDK type.

Environment

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64

Steps to reproduce:

$ cd griffon
// update gradle.properties with groovyVersion = 2.4.14
$ ./gradlew :griffon-javafx-groovy:test


Has anyone experimented a similar error? Any hints would be greatly appreciated :-)

Cheers,
Andres

-------------------------------------------
Java Champion; Groovy Enthusiast
JCP EC Associate Seat
http://andresalmiray.com
http://www.linkedin.com/in/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected compilation error with 2.4.14

paulk_asert
Looks weird. We should never get a VerifyError, so worth raising a bug. That line by itself seems to work okay in a script.
I won't get time until tomorrow to replicate properly. Someone else might jump in in the meantime.

Cheers, Paul.

On Tue, Mar 6, 2018 at 10:23 PM, Andres Almiray <[hidden email]> wrote:
Hello everyone,

I'm in the process of updating the Griffon build to use Groovy 2.4.14 and encountered a weird problem in one of the tests https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

The test runs fine with 2.413 but generates the following stacktrace with 2.4.14

java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
	at java.lang.Class.getConstructor0(Class.java:3075)
	at java.lang.Class.getConstructor(Class.java:1825)
	at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
	at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
	at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
	at groovy.lang.MetaClassImpl.createStaticSite(MetaClassImpl.java:3421)
	at groovy.lang.ExpandoMetaClass.createStaticSite(ExpandoMetaClass.java:1308)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:76)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:161)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
	at griffon.javafx.GriffonFXCollectionsExtensionTest.testOperationsWithObservable(GriffonFXCollectionsExtensionTest.groovy:78)
	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:116)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:59)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:39)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	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:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
	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:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	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:55)
	at java.lang.Thread.run(Thread.java:748)

The "faulty" line is

Function<Integer, Integer> function = Function.identity()

I'm baffled by this error as java.util.function.Function is a core JDK type.

Environment

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64

Steps to reproduce:

$ cd griffon
// update gradle.properties with groovyVersion = 2.4.14
$ ./gradlew :griffon-javafx-groovy:test


Has anyone experimented a similar error? Any hints would be greatly appreciated :-)

Cheers,
Andres

-------------------------------------------
Java Champion; Groovy Enthusiast
JCP EC Associate Seat
http://andresalmiray.com
http://www.linkedin.com/in/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.

Reply | Threaded
Open this post in threaded view
|

Re: Unexpected compilation error with 2.4.14

Jochen Theodorou
In reply to this post by Andres Almiray
On 06.03.2018 13:23, Andres Almiray wrote:

> Hello everyone,
>
> I'm in the process of updating the Griffon build to use Groovy 2.4.14
> and encountered a weird problem in one of the tests
> https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78
>
> The test runs fine with 2.413 but generates the following stacktrace
> with 2.4.14
>
> java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
[...]
> at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
> at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
> at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
> at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
[...]

this is clearly during callsite generation. The generated helper class
to realize the static method call is invalid. I would now go and change
the code to write those classes to disc and then I can look with a
"proper" tool at it. Or I would at least put the ASM verify into the queue

> The "faulty" line is
>
> Function<Integer, Integer> function = Function.identity()
>
> I'm baffled by this error as java.util.function.Function is a core JDK type.
>
> Environment
>
> ------------------------------------------------------------
> Gradle 4.6
> ------------------------------------------------------------
>
> Build time:   2018-02-28 13:36:36 UTC
> Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c
>
> Groovy:       2.4.12
> Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
> JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
> OS:           Mac OS X 10.12.5 x86_64

It is also possible that the code is valid on one JVM and not on
another. 1.8.0_162 seems to be the newest JDK 1.8. Did you try that
exact java version as well Paul?

> Steps to reproduce:
>
> $ git clone https://github.com/griffon/griffon.git
> $ cd griffon
> // update gradle.properties with groovyVersion = 2.4.14
> $ ./gradlew :griffon-javafx-groovy:test

updating gradle.properties is not required, that is set to 2.4.14
already. Instead you should remove the @Ignore in
https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78 


and this also fails with update 152, which reduces my theory, that is
depending on the JVM version

Using 2.5.0-beta-3:  712 tests completed, 208 failed.
Using 2.6.0-alpha-2: 712 tests completed, 52 failed
Using 2.6.0-alpha-3: fails with
>  Could not find groovy-all.jar (org.codehaus.groovy:groovy-all:2.6.0-alpha-3).
>   Searched in the following locations:
>       https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.6.0-alpha-3/groovy-all-2.6.0-alpha-3.jar

did not try 3.0.0-alpha-1, because it is from Nov. last year and did not
have a change I suspect

GriffonFXCollectionsExtensionTest seems to have worked for 2.5 and 2.6
though

> Has anyone experimented a similar error? Any hints would be greatly
> appreciated :-)

I think when I tried fixing Stream.of... which is a very similar case,
since this is a static method on an interface as well. So I know that
e34823cbabbce2a90829ead5d83c72806326946d and similar did cause some
trouble and I do know there have been fixes. But I think they got
applied to all branches. Can it be we forgot to backport something that
got applied to 2.5 and 2.6 (and most likely master), but not 2.4? the
class itself is the same in master and in 2.4.14 and on GROOVY_2_6_X...
GROOVY_2_5_X seems to be missing the change?!

For me this sounds like a "too many branches exception"

bye Jochen

Reply | Threaded
Open this post in threaded view
|

Re: Unexpected compilation error with 2.4.14

paulk_asert
I used 1.8.0_161 but so far have only pasted the problematic line into Groovy Console and run it.

Jochen, your change did seem to be missing on 2_5_X but was on the other branches. I just cherry picked it onto 2_5_X.
I think we need to close off GROOVY-8338 and clone a new issue with a new reproducer.

Cheers, Paul.




On Wed, Mar 7, 2018 at 9:37 AM, Jochen Theodorou <[hidden email]> wrote:
On 06.03.2018 13:23, Andres Almiray wrote:
Hello everyone,

I'm in the process of updating the Griffon build to use Groovy 2.4.14 and encountered a weird problem in one of the tests https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

The test runs fine with 2.413 but generates the following stacktrace with 2.4.14

java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
[...]
        at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
        at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
        at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
[...]

this is clearly during callsite generation. The generated helper class to realize the static method call is invalid. I would now go and change the code to write those classes to disc and then I can look with a "proper" tool at it. Or I would at least put the ASM verify into the queue

The "faulty" line is

Function<Integer, Integer> function = Function.identity()

I'm baffled by this error as java.util.function.Function is a core JDK type.

Environment

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64

It is also possible that the code is valid on one JVM and not on another. 1.8.0_162 seems to be the newest JDK 1.8. Did you try that exact java version as well Paul?

Steps to reproduce:

$ git clone https://github.com/griffon/griffon.git
$ cd griffon
// update gradle.properties with groovyVersion = 2.4.14
$ ./gradlew :griffon-javafx-groovy:test

updating gradle.properties is not required, that is set to 2.4.14 already. Instead you should remove the @Ignore in https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

and this also fails with update 152, which reduces my theory, that is depending on the JVM version

Using 2.5.0-beta-3:  712 tests completed, 208 failed.
Using 2.6.0-alpha-2: 712 tests completed, 52 failed
Using 2.6.0-alpha-3: fails with
 Could not find groovy-all.jar (org.codehaus.groovy:groovy-all:2.6.0-alpha-3).
  Searched in the following locations:
      https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.6.0-alpha-3/groovy-all-2.6.0-alpha-3.jar

did not try 3.0.0-alpha-1, because it is from Nov. last year and did not have a change I suspect

GriffonFXCollectionsExtensionTest seems to have worked for 2.5 and 2.6 though

Has anyone experimented a similar error? Any hints would be greatly appreciated :-)

I think when I tried fixing Stream.of... which is a very similar case, since this is a static method on an interface as well. So I know that e34823cbabbce2a90829ead5d83c72806326946d and similar did cause some trouble and I do know there have been fixes. But I think they got applied to all branches. Can it be we forgot to backport something that got applied to 2.5 and 2.6 (and most likely master), but not 2.4? the class itself is the same in master and in 2.4.14 and on GROOVY_2_6_X... GROOVY_2_5_X seems to be missing the change?!

For me this sounds like a "too many branches exception"

bye Jochen


Reply | Threaded
Open this post in threaded view
|

Re: Unexpected compilation error with 2.4.14

paulk_asert
Okay, I can reproduce now on 2.4.14 and latest 2_4_X using 1.8.0_161.
No problem on that JVM version with 2.5.0-beta-3 or 2_5_X with the cherry-picked change or 2.6.0-alpha-3 or master.

Cheers, Paul.

On Wed, Mar 7, 2018 at 10:13 AM, Paul King <[hidden email]> wrote:
I used 1.8.0_161 but so far have only pasted the problematic line into Groovy Console and run it.

Jochen, your change did seem to be missing on 2_5_X but was on the other branches. I just cherry picked it onto 2_5_X.
I think we need to close off GROOVY-8338 and clone a new issue with a new reproducer.

Cheers, Paul.




On Wed, Mar 7, 2018 at 9:37 AM, Jochen Theodorou <[hidden email]> wrote:
On 06.03.2018 13:23, Andres Almiray wrote:
Hello everyone,

I'm in the process of updating the Griffon build to use Groovy 2.4.14 and encountered a weird problem in one of the tests https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

The test runs fine with 2.413 but generates the following stacktrace with 2.4.14

java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
[...]
        at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
        at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
        at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
[...]

this is clearly during callsite generation. The generated helper class to realize the static method call is invalid. I would now go and change the code to write those classes to disc and then I can look with a "proper" tool at it. Or I would at least put the ASM verify into the queue

The "faulty" line is

Function<Integer, Integer> function = Function.identity()

I'm baffled by this error as java.util.function.Function is a core JDK type.

Environment

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64

It is also possible that the code is valid on one JVM and not on another. 1.8.0_162 seems to be the newest JDK 1.8. Did you try that exact java version as well Paul?

Steps to reproduce:

$ git clone https://github.com/griffon/griffon.git
$ cd griffon
// update gradle.properties with groovyVersion = 2.4.14
$ ./gradlew :griffon-javafx-groovy:test

updating gradle.properties is not required, that is set to 2.4.14 already. Instead you should remove the @Ignore in https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

and this also fails with update 152, which reduces my theory, that is depending on the JVM version

Using 2.5.0-beta-3:  712 tests completed, 208 failed.
Using 2.6.0-alpha-2: 712 tests completed, 52 failed
Using 2.6.0-alpha-3: fails with
 Could not find groovy-all.jar (org.codehaus.groovy:groovy-all:2.6.0-alpha-3).
  Searched in the following locations:
      https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.6.0-alpha-3/groovy-all-2.6.0-alpha-3.jar

did not try 3.0.0-alpha-1, because it is from Nov. last year and did not have a change I suspect

GriffonFXCollectionsExtensionTest seems to have worked for 2.5 and 2.6 though

Has anyone experimented a similar error? Any hints would be greatly appreciated :-)

I think when I tried fixing Stream.of... which is a very similar case, since this is a static method on an interface as well. So I know that e34823cbabbce2a90829ead5d83c72806326946d and similar did cause some trouble and I do know there have been fixes. But I think they got applied to all branches. Can it be we forgot to backport something that got applied to 2.5 and 2.6 (and most likely master), but not 2.4? the class itself is the same in master and in 2.4.14 and on GROOVY_2_6_X... GROOVY_2_5_X seems to be missing the change?!

For me this sounds like a "too many branches exception"

bye Jochen



Reply | Threaded
Open this post in threaded view
|

Re: Unexpected compilation error with 2.4.14

paulk_asert
I created https://issues.apache.org/jira/browse/GROOVY-8494 to track this.

Cheers, Paul.

On Wed, Mar 7, 2018 at 10:34 AM, Paul King <[hidden email]> wrote:
Okay, I can reproduce now on 2.4.14 and latest 2_4_X using 1.8.0_161.
No problem on that JVM version with 2.5.0-beta-3 or 2_5_X with the cherry-picked change or 2.6.0-alpha-3 or master.

Cheers, Paul.

On Wed, Mar 7, 2018 at 10:13 AM, Paul King <[hidden email]> wrote:
I used 1.8.0_161 but so far have only pasted the problematic line into Groovy Console and run it.

Jochen, your change did seem to be missing on 2_5_X but was on the other branches. I just cherry picked it onto 2_5_X.
I think we need to close off GROOVY-8338 and clone a new issue with a new reproducer.

Cheers, Paul.




On Wed, Mar 7, 2018 at 9:37 AM, Jochen Theodorou <[hidden email]> wrote:
On 06.03.2018 13:23, Andres Almiray wrote:
Hello everyone,

I'm in the process of updating the Griffon build to use Groovy 2.4.14 and encountered a weird problem in one of the tests https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

The test runs fine with 2.413 but generates the following stacktrace with 2.4.14

java.lang.VerifyError: (class: java_util_function_Function$identity, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
[...]
        at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:82)
        at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:262)
        at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:295)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
[...]

this is clearly during callsite generation. The generated helper class to realize the static method call is invalid. I would now go and change the code to write those classes to disc and then I can look with a "proper" tool at it. Or I would at least put the ASM verify into the queue

The "faulty" line is

Function<Integer, Integer> function = Function.identity()

I'm baffled by this error as java.util.function.Function is a core JDK type.

Environment

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Mac OS X 10.12.5 x86_64

It is also possible that the code is valid on one JVM and not on another. 1.8.0_162 seems to be the newest JDK 1.8. Did you try that exact java version as well Paul?

Steps to reproduce:

$ git clone https://github.com/griffon/griffon.git
$ cd griffon
// update gradle.properties with groovyVersion = 2.4.14
$ ./gradlew :griffon-javafx-groovy:test

updating gradle.properties is not required, that is set to 2.4.14 already. Instead you should remove the @Ignore in https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx-groovy/src/test/groovy/griffon/javafx/GriffonFXCollectionsExtensionTest.groovy#L78

and this also fails with update 152, which reduces my theory, that is depending on the JVM version

Using 2.5.0-beta-3:  712 tests completed, 208 failed.
Using 2.6.0-alpha-2: 712 tests completed, 52 failed
Using 2.6.0-alpha-3: fails with
 Could not find groovy-all.jar (org.codehaus.groovy:groovy-all:2.6.0-alpha-3).
  Searched in the following locations:
      https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.6.0-alpha-3/groovy-all-2.6.0-alpha-3.jar

did not try 3.0.0-alpha-1, because it is from Nov. last year and did not have a change I suspect

GriffonFXCollectionsExtensionTest seems to have worked for 2.5 and 2.6 though

Has anyone experimented a similar error? Any hints would be greatly appreciated :-)

I think when I tried fixing Stream.of... which is a very similar case, since this is a static method on an interface as well. So I know that e34823cbabbce2a90829ead5d83c72806326946d and similar did cause some trouble and I do know there have been fixes. But I think they got applied to all branches. Can it be we forgot to backport something that got applied to 2.5 and 2.6 (and most likely master), but not 2.4? the class itself is the same in master and in 2.4.14 and on GROOVY_2_6_X... GROOVY_2_5_X seems to be missing the change?!

For me this sounds like a "too many branches exception"

bye Jochen