https://kotlinlang.org logo
#feed
Title
# feed
r

reformator

05/18/2022, 10:22 PM
Hi, everyone! Just released Stacktrace-decoroutinator 2.3.0. Library for recovering stack trace in Kotlin coroutines, supporting JVM and Android. This release includes a usage of JVM Instrumentation API for bytecode manipulation instead of generating separate classes.
👍🏻 1
👍 1
r

Ruben Holen

05/21/2022, 2:02 PM
I tried this, but it breaks Ktor. Just stops accepting requests when enabled
r

reformator

05/21/2022, 2:17 PM
Without throwing any exceptions?
r

Ruben Holen

05/21/2022, 2:39 PM
yeah
Copy code
➜  ~ curl <http://localhost/health>    
curl: (52) Empty reply from server
nothing in the application
r

reformator

05/21/2022, 2:50 PM
May I ask you some questions: 1. Did you call function
DecoroutinatorRuntime.load()
in your app?
r

Ruben Holen

05/22/2022, 10:44 AM
Yes, it only happens when I call it. If I comment that line out, the app works normally
r

reformator

05/22/2022, 10:52 AM
ok. 2. What version of SD and JVM and Kotlin?
r

Ruben Holen

05/22/2022, 11:01 AM
SD 2.3.0 Amazon Corretto 17.0.2 Kotlin 1.6.21
and Ktor 2.0.1
r

reformator

05/22/2022, 12:56 PM
Yeah. I reproduced the issue and will work on it. https://github.com/Anamorphosee/stacktrace-decoroutinator/issues/10. Until the fix you can try the older version "stacktrace-decoroutinator-legacy:2.3.1" which works with Ktor for me.
r

Ruben Holen

05/23/2022, 9:42 AM
legacy fails for me
Copy code
Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @1134affc
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
	at dev.reformator.stacktracedecoroutinator.jvmlegacy.Utils_jvm_legacyKt.getClassIfLoaded(utils-jvm-legacy.kt:11)
	at dev.reformator.stacktracedecoroutinator.runtime.DecoroutinatorRuntime.getState(runtime-jvm-legacy.kt:41)
	at dev.reformator.stacktracedecoroutinator.runtime.DecoroutinatorRuntime.load(runtime-jvm-legacy.kt:51)
	at dev.reformator.stacktracedecoroutinator.runtime.DecoroutinatorRuntime.load$default(runtime-jvm-legacy.kt:50)
Setting the system property you mentioned in the issue doesn't seem to help either
r

reformator

05/23/2022, 10:05 AM
the system property works only for SD version 2.3.1
r

Ruben Holen

05/23/2022, 10:43 AM
ah! yeah, now it works!
👍 1
r

reformator

05/24/2022, 8:14 AM
@Ruben Holen fix for Ktor was releases in 2.3.2
🙌🏻 1
r

Ruben Holen

05/24/2022, 2:13 PM
Thanks
15 Views