Closed kpgalligan closed 5 years ago
Branch in my fork showing crash in iOS sample. The actual crash reports differently there, but it is still misleading as to the cause: https://github.com/kpgalligan/Reaktive/tree/kpg/failcrash
@kpgalligan Thanks for reporting! Would you mind to check how it works on https://github.com/badoo/Reaktive/pull/73 ?
Yes, much better!
Uncaught exception: kotlin.native.concurrent.FreezingException: freezing of com.badoo.reaktive.disposable.DisposableWrapper.Holder@1d65f28 has failed, first blocker is co.touchlab.sessionize.ScheduleModel@871c08kotlin.native.concurrent.FreezingException: freezing of com.badoo.reaktive.disposable.DisposableWrapper.Holder@1d65f28 has failed, first blocker is co.touchlab.sessionize.ScheduleModel@871c08
at 0 iosApp 0x0000000109447226 kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception + 70
at 1 iosApp 0x0000000109447146 kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException + 70
at 2 iosApp 0x00000001096dbf66 kfun:kotlin.native.concurrent.FreezingException.<init>(kotlin.Any;kotlin.Any)kotlin.native.concurrent.FreezingException + 230
at 3 iosApp 0x00000001096dc12a ThrowFreezingException + 90
at 4 iosApp 0x00000001096f2d80 FreezeSubgraph + 368
at 5 iosApp 0x0000000109447957 kfun:kotlin.native.concurrent.freeze@#GENERIC.()Generic + 55
at 6 iosApp 0x0000000109475058 kfun:com.badoo.reaktive.utils.freeze$reaktive@#GENERIC.()Generic + 72
at 7 iosApp 0x0000000109474f65 kfun:com.badoo.reaktive.utils.atomicreference.AtomicReference.freezeIfNeeded#internal + 85
at 8 iosApp 0x000000010948043f kfun:com.badoo.reaktive.utils.atomicreference.AtomicReference.getAndSet(#GENERIC)#GENERIC + 95
at 9 iosApp 0x0000000109480d8b kfun:com.badoo.reaktive.disposable.DisposableWrapper.setHolder#internal + 91
at 10 iosApp 0x00000001094811b2 kfun:com.badoo.reaktive.disposable.DisposableWrapper.set(com.badoo.reaktive.disposable.Disposable?) + 98
at 11 iosApp 0x0000000109481007 kfun:com.badoo.reaktive.observable.<no name provided>_7.setDisposable_11#internal + 71
at 12 iosApp 0x00000001094815a7 kfun:co.touchlab.sessionize.reaktive.asObservable$lambda-0#internal + 151
at 13 iosApp 0x00000001094814c7 kfun:co.touchlab.sessionize.reaktive.$asObservable$lambda-0$FUNCTION_REFERENCE$94.invoke#internal + 71
at 14 iosApp 0x000000010948142b kfun:co.touchlab.sessionize.reaktive.$asObservable$lambda-0$FUNCTION_REFERENCE$94.$<bridge-UNNN>invoke(#GENERIC)#internal + 75
at 15 iosApp 0x000000010948090a kfun:com.badoo.reaktive.observable.<no name provided>_1.subscribe_2#internal + 266
at 16 iosApp 0x0000000109472a5e kfun:com.badoo.reaktive.observable.subscribeSafe$reaktive@com.badoo.reaktive.observable.Observable<#GENERIC>.(com.badoo.reaktive.observable.ObservableObserver<#GENERIC>)Generic + 110
at 17 iosApp 0x0000000109472708 kfun:com.badoo.reaktive.observable.observeOn$lambda-2#internal + 296
at 18 iosApp 0x000000010947259b kfun:com.badoo.reaktive.observable.$observeOn$lambda-2$FUNCTION_REFERENCE$108.invoke#internal + 75
at 19 iosApp 0x00000001094724fb kfun:com.badoo.reaktive.observable.$observeOn$lambda-2$FUNCTION_REFERENCE$108.$<bridge-UNNN>invoke(#GENERIC)#internal + 75
at 20 iosApp 0x000000010948090a kfun:com.badoo.reaktive.observable.<no name provided>_1.subscribe_2#internal + 266
at 21 iosApp 0x0000000109472a5e kfun:com.badoo.reaktive.observable.subscribeSafe$reaktive@com.badoo.reaktive.observable.Observable<#GENERIC>.(com.badoo.reaktive.observable.ObservableObserver<#GENERIC>)Generic + 110
at 22 iosApp 0x0000000109472708 kfun:com.badoo.reaktive.observable.observeOn$lambda-2#internal + 296
at 23 iosApp 0x000000010947259b kfun:com.badoo.reaktive.observable.$observeOn$lambda-2$FUNCTION_REFERENCE$108.invoke#internal + 75
at 24 iosApp 0x00000001094724fb kfun:com.badoo.reaktive.observable.$observeOn$lambda-2$FUNCTION_REFERENCE$108.$<bridge-UNNN>invoke(#GENERIC)#internal + 75
at 25 iosApp 0x000000010948090a kfun:com.badoo.reaktive.observable.<no name provided>_1.subscribe_2#internal + 266`
Glad that it helped! I have another question, are you testing on simulator? If so then is there any chance you could test it on a real iOS device? We are exploring the idea of sharing common code with iOS team but their concern is unreadable stack traces (without debug symbols, only offsets in memory). So I would like to see how they actually look.
That’s a complex topic. My current focus is making the iOS dev experience better in general. For example, kotlin Xcode plugin https://github.com/touchlab/xcode-kotlin. There are crashes locally, and crashes in release builds with Crashlytics (etc). We’re actively working on improving the latter. I’m on my phone now but can chat another time. If you’ve got an email address or you’re on the kotlin slack that would be better for some details
That’s a complex topic. My current focus is making the iOS dev experience better in general. For example, kotlin Xcode plugin https://github.com/touchlab/xcode-kotlin. There are crashes locally, and crashes in release builds with Crashlytics (etc). We’re actively working on improving the latter. I’m on my phone now but can chat another time. If you’ve got an email address or you’re on the kotlin slack that would be better for some details
Thanks, dropped you a message in slack.
I have a forked version from a few days ago, so almost master. The following crashes, and in an unpleasant way:
The lamba to
subscribe
captures the object instance ofFailTests
, but that has hadensureNeverFrozen()
called on it, so it should crash. However, rather than report an unhandled exception, we get a low level C++ runtime crash.From the stack in xcode
The assert is coming from kotlin native's runtime. It looks like something in interop, but that's a complex sequence and a very unexpected error. If you remove
ensureNeverFrozen()
or avoid freezing (https://github.com/touchlab/DroidconKotlin/blob/kpg/reaktive/sessionize/lib/src/commonMain/kotlin/co/touchlab/sessionize/reaktive/ReaktiveExtensions.kt#L65), you avoid the crash.