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

Caused by: java.lang.VerifyError: Operand stack overflow #3232

Closed
ivorobioff4grada opened this issue Jul 27, 2023 · 2 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2790
Closed
Assignees
Labels

Comments

@ivorobioff4grada
Copy link

ivorobioff4grada commented Jul 27, 2023

I get the following error for no reason when starting my Boot Spring project. Before updating to version v1.21.0 (that is, v1.20.0) everything worked well.

Environment
  • Operating System: Windows 11 (WSL)
  • JDK version: /.vscode-server/extensions/redhat.java-1.21.0-linux-x64/jre/17.0.7-linux-x86_64/bin/java
  • Visual Studio Code version: 1.80.1
  • Java extension version: v1.21.1
  • Spring Boot: v2.6.4

Here's the complete error:

Caused by: java.lang.VerifyError: Operand stack overflow
Exception Details:
  Location:
    com/xxx/xxx/services/URIService.getValue(Ljava/util/Iterator;)Ljava/lang/String; @39: ldc
  Reason:
    Exceeded max stack size.
  Current Frame:
    bci: @39
    flags: { }
    locals: { 'com/xxx/xxx/services/URIService', 'java/util/Iterator', 'java/lang/String' }
    stack: { 'java/lang/String', 'java/lang/String' }
  Bytecode:
    0000000: 2bb9 007c 0100 9900 3d2b b900 7401 00c0
    0000010: 007a 4d2c ba00 de00 00b6 00e1 9900 0801
    0000020: 4da7 0024 2c12 e512 e7b6 00e9 b200 edb6
    0000030: 00f3 b800 f812 e712 fdb6 00e9 b600 a54d
    0000040: a700 0501 4d2c b0                      
  Stackmap Table:
    append_frame(@36,Object[#122])
    chop_frame(@67,1)
    append_frame(@69,Object[#122])

        at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
        at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[na:na]
        at java.base/java.lang.Class.getDeclaredMethods(Unknown Source) ~[na:na]
        at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467) ~[spring-core-5.3.16.jar:5.3.16]
        ... 158 common frames omitted

An interesting fact, here's the code causing that error:

private String getValue(final Iterator<String> it) throws UnsupportedEncodingException {
        String value;
        if (it.hasNext()) {
            value = it.next();
            if (value.equalsIgnoreCase("" + null)) {
                value = null;
            } else {
                value = URLDecoder
                        .decode(value.replaceAll("\\+", "%2B"), StandardCharsets.UTF_8.name())
                        .replaceAll("%2B", "+")
                        .trim();
            }
        } else {
            value = null;
        }
        return value;
    }

if I remove or replace invocation of replaceAll everything works well. So, it has something to do with regex pattern!

Thanks!

@snjeza
Copy link
Contributor

snjeza commented Jul 31, 2023

This is an upstream Eclipse issue.
See

@ivorobioff4grada you can try to set

org.eclipse.jdt.core.compiler.codegen.useStringConcatFactory = disabled

to <your_project>/.settings/org.eclipse.jdt.core.prefs

@ivorobioff4grada
Copy link
Author

@snjeza thanks, it worked out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants