-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Exception in coroutines machinery (ClassCastException) affecting only few android 5 users #2763
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
Could be the same as #2736. |
In error message (first line of stacktrace) there is a reference "Continuation at <....>.Repository$updateCacheVariants$1.invokeSuspend(Repository.kt)@2b36bba8]){Cancelled}@a821e66" -
Thank you will try it out. |
I can add that extracting launch body to a separate method doesn't help. |
Deobfuscated version
So seems the same as #2736 but happening exclusively on android 5 devices. |
Could you please elaborate on the coroutines versions? We expect this bug to be fixed in version 1.5.1 |
I use 1,5,0, |
This is not fixed in 1.5.1. |
Could you please share the new stacktrace? |
I can reproduce this issue reliably on a Pixel C emulator with Android 10 (API 29). It doesn't happen with same app code on my Pixel 2. Coroutines version 1.5.1
The line of app code the stacktrace refers to is just calling a suspend function on a 'Retrofit' interface. |
Could you please share your reproducer? It would significantly simplify the investigation |
As in a project? Sorry I can't share the full source code for the project I work on. I don't think the issue is related to the project it is within, but more the environment, i.e. it happens in Android on the Pixel C emulator from Android studio for me, but not on my physical Pixel 2 device. This crashes the app the second the app starts when it calls its first suspend function and is reproducible 100% of the time. I.e. it renders the app unusable. It looks like rolling back to Kotlin 1.5.21 has stopped it happening on every run of the app for me. |
New stacktrace as asked for coroutines 1.5.1. Kotlin version 1.5.21.
For reference, I still see this issue very rarely only on android 5 devices of the users. I cannot reproduce it on emulator. |
Strange thing here is why google Crashlytics doesn't deobfuscate paths for:
I have to do it manually from proguard mapping file that was downloading to google together with the app. Other crashes are completely deobfuscated. I don't think it's connected with the issue, but just in case. |
@lordcodes it would be nice if you could share not the whole application, but only the relevant piece of machinery that crashes, if that is okay with you. Also, please ensure that you are using coroutines 1.5.1 and not i.e. 1.5.0 |
@qwwdfsad I will try and see if I can create a sample app that has the same issue. However, once it boils down to what is actually crashing it would just be an app that includes Coroutines and calls a suspend function, i.e. like any other project. The project I work on doesn't do anything special with Coroutines, just includes the library and then uses them. However, when I get a chance I will try and create a small sample project. |
I have been using coroutines 1.5.0 in my Android project for a while and haven't seen this issue. Last night I updated to Kotlin 1.5.30 and got this crash (I also get it on coroutines 1.5.1):
It seems to only be happening when I use my
This is how I invoke it at the location that is crashing:
If I replace the If I downgrade to Kotlin 1.5.21 it doesn't crash with either coroutines 1.5.0 or 1.5.1 I'd say this line looks suspect - https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/CoroutineDispatcher.kt#L107 |
Those are my findings too, I rolled back to Kotlin 1.5.21 and now everything is working fine. I had never seen this crash until right after I upgraded to Kotlin 1.5.30. |
Maybe this issue deserves an entry on YouTrack since it seems to be related to Kotlin 1.5.30? https://kotl.in/issue |
Just for the record (observed only once, cannot reproduce), this has occurred on a non-Android JVM with Kotlin 1.5.31 and coroutines 1.5.2:
Stack trace:
|
@OliverO2 Can you comment in the YouTrack issue linked above? Ideally, you can also put a reproducing snippet there to help QA reproduce it. |
Found another crash, probably related to this one
|
Fixed in Kotlin 1.6.0 |
my Kotlin version is 1.6.10, this bug happened again......
|
Kotlin 1.5.10, coroutines 1.4.3 (checked changelog - looks like not fixed)
This is happening to 200 users (800 crashes) only on android 5 (I have at least 8000 android 5 users in last week.)
Not reproducible.
While I'm investigating why stacktrace is obfuscated (Firebase should deobfuscate stacktraces automatically), reporting it now so you may have some feedback.
The code in referenced repository is as following
The text was updated successfully, but these errors were encountered: