-
Notifications
You must be signed in to change notification settings - Fork 1.9k
kotlinx.coroutines.debug
's DebugProbes
fails when loaded from a different ClassLoader than kotlin.stdlib
#4000
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
Comments
kotlinx.coroutines.debug
's DebugProbes
fails when used from a different ClassLoader as kotlin.stdlib
kotlinx.coroutines.debug
's DebugProbes
fails when loaded from a different ClassLoader than kotlin.stdlib
Thanks! Could you please elaborate on the following:
|
Indeed, we solve the package split internally, but we are stuck on that classloader issue, and it seems there is nothing easy we can do on our side to address it. Here is the ticket: https://youtrack.jetbrains.com/issue/FL-23308
Yes, that's most probably possible, and we would be our pleasure to help testing it out. |
Thanks! |
We've discussed it further and I also investigated why IDEA does not have this problem. The short summary:
If you or anybody else have any other ideas how we can patch these things up, I'm open to suggestions |
Describe the bug
DebugProbes.install()
works, but the code crashed when spawning the first coroutine after installation, withjava.lang.ClassNotFoundException: kotlinx.coroutines.debug.internal.DebugProbesImpl
.First, a quick context on our different module layers hierarchy (we use JPMS), our module layers are structured like such:
Note: Module layers does not have names, I just name them by the most significant module that is part of it for convenience.
Here is what I think is happening, internally, when doing
DebugProbes.install()
,kotlinx.coroutines.debug
uses ByteBuddy to swapkotlin.stdlib
'skotlin.coroutines.jvm.internal.DebugProbesKt
code with the code fromkotlinx.coroutines.core
'skotlinx.coroutines.debug.internal.DebugProbesKt
.This runtime injected code tries to use
DebugProbesImpl
object fromkotlinx.coroutines.core
module. But it does that at thekotlin.stdlib
level, so using thefleet.dock.bootstrap
's ClassLoader (AppClassLoader
), which does not know aboutkotlinx.coroutines.core
module and so it crashes withClassNotFoundException
.The text was updated successfully, but these errors were encountered: