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

Handle invokeSuspend edge case in the Weaver #2201

Open
kanderson250 opened this issue Jan 13, 2025 · 1 comment · May be fixed by #2228
Open

Handle invokeSuspend edge case in the Weaver #2201

kanderson250 opened this issue Jan 13, 2025 · 1 comment · May be fixed by #2228
Assignees
Labels
3 Story Point Estimate jan-mar qtr Represents proposed work item for the Jan-Mar quarter

Comments

@kanderson250
Copy link
Contributor

In an effort to support Kotlin Coroutines instrumentation, modify the weaver to support the edge case presented by Kotlin bytecode for invokeSuspend.

The issue was investigated as a spike in #2002 , where errors were thrown during weaving of invokeSuspend. The investigation found that the Kotlin compiler intentionally duplicates operands on the stack prior to return instructions in the body of invokeSuspend. Though innocuous for return instructions, these extra operands cause bytecode verification to fail when return is replaced with goto (which is how the agent performs its bytecode modification).

We should update the weaver to handle this edge case, so that weaving for invokeSuspend succeeds. This fix should be wrapped in a feature flag/some kind of blocker to prevent the fix from applying to any other methods at this time.

@kanderson250 kanderson250 added the 3 Story Point Estimate label Jan 13, 2025
@kanderson250 kanderson250 self-assigned this Jan 13, 2025
@workato-integration
Copy link

@kanderson250 kanderson250 moved this from Triage to In Sprint in Java Engineering Board Jan 13, 2025
@kmudduluru kmudduluru added the jan-mar qtr Represents proposed work item for the Jan-Mar quarter label Jan 21, 2025
@kmudduluru kmudduluru moved this from In Sprint to In Progress in Java Engineering Board Jan 22, 2025
@kanderson250 kanderson250 linked a pull request Jan 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 Story Point Estimate jan-mar qtr Represents proposed work item for the Jan-Mar quarter
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants