Skip to content
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

concurent modification crashes app #26

Open
hatched-MaciejPrzybylski opened this issue May 31, 2024 · 12 comments
Open

concurent modification crashes app #26

hatched-MaciejPrzybylski opened this issue May 31, 2024 · 12 comments
Assignees

Comments

@hatched-MaciejPrzybylski
Fatal Exception: java.util.ConcurrentModificationException
java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1029)
java.util.ArrayList$Itr.next (ArrayList.java:982)
com.radiusnetworks.flybuy.sdk.pickup.helper.c.a (SourceFile:746)
com.radiusnetworks.flybuy.sdk.pickup.helper.c.a (SourceFile:378)
com.radiusnetworks.flybuy.sdk.pickup.service.l.invokeSuspend (SourceFile:4)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
kotlinx.coroutines.internal.LimitedDispatcher$Worker.run (LimitedDispatcher.java:111)
kotlinx.coroutines.scheduling.TaskImpl.run (Tasks.kt:99)
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java:585)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:802)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:706)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:693)
@botnerd
Copy link
Member

botnerd commented Jun 3, 2024

Can you please provide details on which version of the SDK you are using, what android SDK version you are targeting, and the android device information?

@hatched-MaciejPrzybylski
Copy link
Author

android target: 33
flybyy version 2.10.0

@botnerd
Copy link
Member

botnerd commented Jun 4, 2024

SDK version 2.10.0 and higher require targeting Android 14. Please see these upgrade instructions as there are some small changes that need to be addressed.

@hatched-mariusz
Copy link

We updated the Android target to 34 and the flybuy version to 2.12.0
And still, we see the issue:
BTW how android target version can fix ConcurrentModificationException error?

  Fatal Exception: java.util.ConcurrentModificationException:
       at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1029)
       at java.util.ArrayList$Itr.next(ArrayList.java:982)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.b(SourceFile:639)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.a(SourceFile:381)
       at com.radiusnetworks.flybuy.sdk.pickup.service.l.invokeSuspend(SourceFile:4)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:111)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:585)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
       ```

@botnerd botnerd self-assigned this Jul 16, 2024
@botnerd
Copy link
Member

botnerd commented Jul 16, 2024

Do you have any steps to reproduce the issue? If not, can you provide details on what method you are calling when this happens? If it's happening on startup, please provide details on how you are initializing the SDK.

@hatched-mariusz
Copy link

hatched-mariusz commented Jul 17, 2024

We initialize the SDK as how it is on the instruction.
The issue is rare and we don't have the reproduce steps but I think ConcurrentModificationException is kind a bug of issue that is hard to reproduce.
Please check your code. ConcurrentModificationException is a programming issue. Your code is not thread-safe and there should be no more questions for Us.
In the stack trace, there is no app package, it is thrown from your service, and we can not even catch that issue and ignore it.
Please read this https://docs.oracle.com/javase/8/docs/api/java/util/ConcurrentModificationException.html

I check the binary code and U just assigns a reference of one list and uses on that list two operations (I don't know what operations but 2 on the same reference ) this can make that error especially that CoroutineScopeKt.CoroutineScope(Dispatchers.getIO()); is used. Use the copy() method or other thread-safe operation

@hatched-MaciejPrzybylski
Copy link
Author

hatched-MaciejPrzybylski commented Jul 17, 2024

flybuy sdk is very low quality. You have stack trace so I assume you can read it

@botnerd
Copy link
Member

botnerd commented Jul 17, 2024

Unfortunately, the stack trace is obfuscated. Please update to v2.12.1 (just released) that fixes a bug that was preventing us from getting crash logs on our end.

@hatched-mariusz
Copy link

We updated the SDK to v2.12.1 as U asked and we still see the issue:
As U see from the stack trace there are no package names, the fatal issue comes from your SDK.
Please fix that.
BTW we see the new issue with permissions but I will create new ticket for that.

Fatal Exception: java.util.ConcurrentModificationException:
       at java.util.ArrayList$Itr.next(ArrayList.java:860)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.b(SourceFile:639)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.a(SourceFile:381)
       at com.radiusnetworks.flybuy.sdk.pickup.service.l.invokeSuspend(SourceFile:4)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:111)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)

@hatched-mariusz
Copy link

We updated the SDK to v2.12.12 and we still see the issue:
As you see from the stack trace there are no package names from the app, the fatal issue comes from your SDK.

          Fatal Exception: java.util.ConcurrentModificationException:
       at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1029)
       at java.util.ArrayList$Itr.next(ArrayList.java:982)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.b(SourceFile:639)
       at com.radiusnetworks.flybuy.sdk.pickup.helper.c.a(SourceFile:381)
       at com.radiusnetworks.flybuy.sdk.pickup.service.m.invokeSuspend(SourceFile:4)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:111)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
        

@hatched-mariusz
Copy link

The same issue is in version 2.13.0 of Android target SDK 34.
ConcurrentModificationException not depend on android SDK, someone makes a remove operation on the iterated array list.

@botnerd
Copy link
Member

botnerd commented Sep 26, 2024

We'll look into this further to see if we can find the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants