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
Open

Handle invokeSuspend edge case in the Weaver #2201

kanderson250 opened this issue Jan 13, 2025 · 1 comment
Assignees
Labels
3 Story Point Estimate

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 Story Point Estimate
Projects
Status: In Sprint
Development

No branches or pull requests

1 participant