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

[Kotlin] Inconsistent stackmap frames after upgrade do javagent 1.29.0 #9312

Closed
cleidiano opened this issue Aug 25, 2023 · 0 comments · Fixed by #9313
Closed

[Kotlin] Inconsistent stackmap frames after upgrade do javagent 1.29.0 #9312

cleidiano opened this issue Aug 25, 2023 · 0 comments · Fixed by #9313
Labels
bug Something isn't working

Comments

@cleidiano
Copy link

cleidiano commented Aug 25, 2023

Describe the bug

Instantiate a Kotlin class that has a constructor with default argument fail with java.lang.VerifyError.

This error blowup after upgrade the open telemetry javaagent to version 1.29.0 to get the improvement for instrumentation with @WithSpan to kotlin coroutine at PR #8870.

Steps to reproduce

Instrument a kotlin suspend function at class that has a constructor with default argument.
The repo https://github.com/cleidiano/open-telemetry-inconsistent-stackmap-frames/ could be used to reproduce the issue:

Start the above project by running ./gradlew run and then reach the url at http://localhost:8080

Expected behavior

Instantiate a kotlin class that has a constructor with default argument shouldn't throws java.lang.VerifyError.

Actual behavior

java.lang.VerifyError: Inconsistent stackmap frames at branch target 9
Exception Details:
  Location:
    com/example/plugins/ClazzDefaultConstructorArguments.<init>(Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @9: aload_0
  Reason:
    Type uninitializedThis (current frame, locals[0]) is not assignable to 'com/example/plugins/ClazzDefaultConstructorArguments' (stack map, locals[0])
  Current Frame:
    bci: @3
    flags: { flagThisUninit }
    locals: { uninitializedThis, 'java/lang/String', integer, 'kotlin/jvm/internal/DefaultConstructorMarker' }
    stack: { integer }
  Stackmap Frame:
    bci: @9
    flags: { }
    locals: { 'com/example/plugins/ClazzDefaultConstructorArguments', 'java/lang/String', integer, 'kotlin/jvm/internal/DefaultConstructorMarker' }
    stack: { }
  Bytecode:
    0000000: 1c04 7e99 0006 121a 4c2a 2bb7 001c b1  
  Stackmap Table:
    full_frame(@9,{Object[#2],Object[#140],Integer,Object[#142]},{})

Javaagent or library instrumentation version

Javaagent 1.29.0

Environment

JDK: OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)
OS: MacOS 13.3.1
Kotlin: 1.9.10
Ktor: 2.3.3

Additional context

No response

@cleidiano cleidiano added bug Something isn't working needs triage New issue that requires triage labels Aug 25, 2023
@trask trask removed the needs triage New issue that requires triage label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants