You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get a stack trace in code that generates error inside runBlocking.
I'm unable to get full StackTrace here. I am still facing this issue even if I enable stack trace recovery
The internal assertions in the library are also permanently removed.
Can you confirm if this is responsible for StackTrace issue, if yes do we have any alternative?
My code looks something like this:
fun main() {
firstCall()
}
fun firstCall() {
secondCall()
}
fun secondCall() {
crashCall()
}
fun crashCall(): String {
return runBlocking {
getData().map {
it!!
}.catch { e ->
throw e
}.flowOn(Dispatchers.IO)
.first()
}
}
fun getData(): Flow<String?> {
val temp: String? = null
return flowOf(temp)
}
StackTrace looks like this:
Exception in thread "main" java.lang.NullPointerException
at package.TestKt$crashCall$1$invokeSuspend$$inlined$map$1$2.emit(Emitters.kt:224)
at kotlinx.coroutines.flow.FlowKt__BuildersKt$flowOf$$inlined$unsafeFlow$2.collect(SafeCollector.common.kt:113)
at package.TestKt$crashCall$1$invokeSuspend$$inlined$map$1.collect(SafeCollector.common.kt:113)
at kotlinx.coroutines.flow.FlowKt__ErrorsKt.catchImpl(Errors.kt:156)
at kotlinx.coroutines.flow.FlowKt.catchImpl(Unknown Source)
at kotlinx.coroutines.flow.FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:113)
at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(ChannelFlow.kt)
at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
The text was updated successfully, but these errors were encountered:
I'm trying to get a stack trace in code that generates error inside runBlocking.
I'm unable to get full StackTrace here. I am still facing this issue even if I enable stack trace recovery
Note:Our builds are optimised with R8 and as mentioned in https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/kotlinx-coroutines-android/README.md#optimization
When optimizations are enabled with R8 version 1.6.0 or later the following debugging features are permanently turned off to reduce the size of the resulting binary:
Can you confirm if this is responsible for StackTrace issue, if yes do we have any alternative?
My code looks something like this:
fun main() {
firstCall()
}
fun firstCall() {
secondCall()
}
fun secondCall() {
crashCall()
}
fun crashCall(): String {
return runBlocking {
getData().map {
it!!
}.catch { e ->
throw e
}.flowOn(Dispatchers.IO)
.first()
}
}
fun getData(): Flow<String?> {
val temp: String? = null
return flowOf(temp)
}
StackTrace looks like this:
Exception in thread "main" java.lang.NullPointerException
at package.TestKt$crashCall$1$invokeSuspend$$inlined$map$1$2.emit(Emitters.kt:224)
at kotlinx.coroutines.flow.FlowKt__BuildersKt$flowOf$$inlined$unsafeFlow$2.collect(SafeCollector.common.kt:113)
at package.TestKt$crashCall$1$invokeSuspend$$inlined$map$1.collect(SafeCollector.common.kt:113)
at kotlinx.coroutines.flow.FlowKt__ErrorsKt.catchImpl(Errors.kt:156)
at kotlinx.coroutines.flow.FlowKt.catchImpl(Unknown Source)
at kotlinx.coroutines.flow.FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:113)
at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(ChannelFlow.kt)
at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
The text was updated successfully, but these errors were encountered: