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

StackOverflowError in a Mock call #1909

Open
mfriedenhagen opened this issue Mar 6, 2024 · 2 comments
Open

StackOverflowError in a Mock call #1909

mfriedenhagen opened this issue Mar 6, 2024 · 2 comments
Labels
3rd-party: geantyref bug regression Something that worked before and now is broken

Comments

@mfriedenhagen
Copy link

Describe the bug

  • We have a test where the single method mocked collaborator is called three times in a row with slightly different parameters.
  • This changed behavior was introduced while updating from 2.4-M1-groovy-4.0 to v2.4-m2-groovy-4.0
  • We use Maven 3.9.6, Java release is Temurin-17.0.10+7, test fails on both Linux Debian 12 as well as on macOS 14.3.1 (23D60).
  • The first method call does succeed but the second leads to a StackOverflowError:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.034 s <<< FAILURE! -- in org.example.ValidatorTest
5605 [ERROR] org.example.ValidatorTest.Overflow? -- Time elapsed: 1.017 s <<< ERROR!
java.lang.StackOverflowError
	at java.base/java.lang.Class.getExecutableTypeAnnotationBytes(Class.java:3451)
	at java.base/java.lang.System$2.getRawExecutableTypeAnnotations(System.java:2367)
	at io.leangen.geantyref.VarMap.map(VarMap.java:98)
	at io.leangen.geantyref.VarMap.map(VarMap.java:115)
	at io.leangen.geantyref.VarMap.map(VarMap.java:148)
	at io.leangen.geantyref.VarMap.map(VarMap.java:98)
  • I will link a reproducer.

To Reproduce

See https://github.com/mfriedenhagen/spock-stackoverflowerror

Expected behavior

Test runs successfully

Actual behavior

Test fails when using v2.4-m2-groovy-4.0

Java version

openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode)

Buildtool version

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /usr/local/Cellar/maven/3.9.6/libexec
Java version: 17.0.10, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "14.3.1", arch: "x86_64", family: "mac"

What operating system are you using

Mac

Dependencies

org.example:spock-stackoverflowerro:jar:1.0-SNAPSHOT
+- net.bytebuddy:byte-buddy:jar:1.14.12:test
+- org.mockito:mockito-core:jar:5.10.0:test
| +- net.bytebuddy:byte-buddy-agent:jar:1.14.11:test
| - org.objenesis:objenesis:jar:3.3:test
- org.spockframework:spock-core:jar:2.4-M2-groovy-4.0:test
+- org.apache.groovy:groovy:jar:4.0.18:test
+- org.junit.platform:junit-platform-engine:jar:1.10.2:test
| +- org.opentest4j:opentest4j:jar:1.3.0:test
| +- org.junit.platform:junit-platform-commons:jar:1.10.2:test
| - org.apiguardian:apiguardian-api:jar:1.1.2:test
+- org.hamcrest:hamcrest:jar:2.2:test
- io.leangen.geantyref:geantyref:jar:1.3.15:test

Additional context

No response

@AndreasTu
Copy link
Member

I will have a look at that next week. It has probably something to do with the dependency change from gentyref to geantyref in 2.4-M2.

@AndreasTu
Copy link
Member

This is an issue in the geantyref library. I have opened an issue there: leangen/geantyref#27

@AndreasTu AndreasTu added 3rd-party: geantyref regression Something that worked before and now is broken labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party: geantyref bug regression Something that worked before and now is broken
Projects
None yet
Development

No branches or pull requests

2 participants