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
Inconsistent stackmap frames
issue while instrumenting Kotlin anonymous class
#275
Comments
Hi, I cannot investigate this problem without the class file (or disassembled dump) for |
Hi @chibash , I have added all the class files which you can find here: https://github.com/serkan-ozal/javassist-issue-report/tree/master/target/classes/ozal/serkan/javassist/issue/report By the way, Javassist version is |
Can you insert
and upload the generated file under |
It seems that the Kotlin compiler generates somewhat nasty bytecode; it pushes an unused value onto the stack. This seems to confuse Javassist. Fixing it will take time... |
Hi @chibash |
Hi @chibash , |
I'm working... |
Can you try master:HEAD? I've added The second argument |
Hi @chibash ,
|
@chibash By the way, issue seems to be fixed with your latest commit but as I said the |
Additionally, isn't it better to check whether or not the target class is Kotlin class on Javassist side? I think, the code snipped shown above can be used in the static boolean isKotlinClass(CtClass clazz) {
return clazz.hasAnnotation("kotlin.Metadata");
} |
Checking kotlin.Metadata seems a good idea. |
@chibash Same approach is also used by Spring framework: https://github.com/spring-projects/spring-framework/pull/1060/files#diff-244315b45582a5b7573a15644b16c373R48 |
@chibash By the way, as I said
|
Thanks @chibash When you are going to release |
I plan to release it at the end of this month. |
I've just released. It'll be available from maven within several days. |
3.25 fixes: - jboss-javassist/javassist#72 - jboss-javassist/javassist#241 - jboss-javassist/javassist#242 - jboss-javassist/javassist#246 - jboss-javassist/javassist#252 3.26 fixes: - jboss-javassist/javassist#265 - jboss-javassist/javassist#270 - jboss-javassist/javassist#271 - jboss-javassist/javassist#275 Of these #270 is most important, as it fixes an issue we've seen with powermock downstream. Change-Id: Ib4d75d6411e71438436249a8eb9313ccf4411ca2 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3.25 fixes: - jboss-javassist/javassist#72 - jboss-javassist/javassist#241 - jboss-javassist/javassist#242 - jboss-javassist/javassist#246 - jboss-javassist/javassist#252 3.26 fixes: - jboss-javassist/javassist#265 - jboss-javassist/javassist#270 - jboss-javassist/javassist#271 - jboss-javassist/javassist#275 Of these #270 is most important, as it fixes an issue we've seen with powermock downstream. Change-Id: Ib4d75d6411e71438436249a8eb9313ccf4411ca2 Signed-off-by: Robert Varga <robert.varga@pantheon.tech> (cherry picked from commit 6a404f1)
3.25 fixes: - jboss-javassist/javassist#72 - jboss-javassist/javassist#241 - jboss-javassist/javassist#242 - jboss-javassist/javassist#246 - jboss-javassist/javassist#252 3.26 fixes: - jboss-javassist/javassist#265 - jboss-javassist/javassist#270 - jboss-javassist/javassist#271 - jboss-javassist/javassist#275 Of these #270 is most important, as it fixes an issue we've seen with powermock downstream. Change-Id: Ib4d75d6411e71438436249a8eb9313ccf4411ca2 Signed-off-by: Robert Varga <robert.varga@pantheon.tech> (cherry picked from commit 6a404f1)
Hi @chibash ,
https://github.com/serkan-ozal/javassist-issue-report/blob/master/src/main/java/ozal/serkan/javassist/issue/report/RunnerInstrumentation.java reproduces the following issue:
The problem is that while instrumenting
ozal.serkan.javassist.issue.report.Runner$run$result$1
anonymous Kotlin class, the stackmap inconsistency raises.The text was updated successfully, but these errors were encountered: