-
Notifications
You must be signed in to change notification settings - Fork 471
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
Spock 2.4-M5 VerifyError: Stack map does not match the one at exception handler
#2080
Comments
Run `./gradlew -Dvariant=4.0 --stacktrace :spock-specs:test --tests StackframeReproducer`
VerifyError: Stack map does not match the one at exception handler
VerifyError: Stack map does not match the one at exception handler
This can be narrowed down to the changes made by the addBlockListener() call in |
@leonard84 @paulk-asert try {
org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0)
a = ''
org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0)
org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1)
try { Whereas the instruction When the ASM Label is generated, the class Now when the second Now the ASM code To check all my reasoning I have added the following code into if (blockInfo == BlockParseInfo.WHEN) {
stat.getStatementLabels().remove(BlockParseInfo.WHEN.toString());
} This removes the So my proposal whould be to remove the consumed "special" Statement labels from the Groovy AST during the rewrite. |
But this is clearly a Groovy bug, isn't it, and I'd say it should be fixed by Groovy. |
Describe the bug
Groovy seems to write invalid class files in combination with Spock 2.4-M5 for certain tests.
Class file + disassembled bytecode: StackframeReproducer.zip
https://github.com/leonard84/spock/tree/stackframe-reproducer
https://github.com/leonard84/spock/actions/runs/12688993419 shows it fails with all Groovy 2.5, 3, 4 and Java 8, 11, 17, 21 versions
To Reproduce
Expected behavior
Test can be executed
Actual behavior
Java version
Java 8
Buildtool version
Gradle 8.12
Build time: 2024-12-20 15:46:53 UTC
Revision: a3cacb207fec727859be9354c1937da2e59004c1
Kotlin: 2.0.21
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM: 21.0.1 (BellSoft 21.0.1+12-LTS)
Daemon JVM: /Users//.asdf/installs/java/liberica-21.0.1+12 (no JDK specified, using current Java home)
OS: Mac OS X 15.2 aarch64
What operating system are you using
Mac OS X 15.2 aarch64
Dependencies
groovy4 = '4.0.24'
Additional context
No response
The text was updated successfully, but these errors were encountered: