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

RoomDecryptorProvider.getOrCreateRoomDecryptor.onNewSession ConcurrentModificationException #5746

Open
ouchadam opened this issue Apr 12, 2022 · 4 comments · Fixed by #5747
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash

Comments

@ouchadam
Copy link
Contributor

ouchadam commented Apr 12, 2022

java.util.ConcurrentModificationException: 
  at java.util.ArrayList$Itr.next (ArrayList.java:860)
  at org.matrix.android.sdk.internal.crypto.RoomDecryptorProvider$getOrCreateRoomDecryptor$alg$1$1.onNewSession (RoomDecryptorProvider.kt:3)
  at org.matrix.android.sdk.internal.crypto.algorithms.megolm.MXMegolmDecryption.onNewSession (MXMegolmDecryption.kt:5)
  at org.matrix.android.sdk.internal.crypto.algorithms.megolm.MXMegolmDecryption.onRoomKeyEvent (MXMegolmDecryption.kt:86)
  at org.matrix.android.sdk.internal.crypto.DefaultCryptoService$onToDeviceEvent$1.invokeSuspend (DefaultCryptoService.kt:171)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:3)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:18)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:233)
  at android.os.HandlerThread.run (HandlerThread.java:67)
Occurrences (30 days) Total Occurrences Impacted users (lifetime)
29 29 28

https://play.google.com/console/u/0/developers/{redacted}/app/{redacted}/vitals/crashes/6bfcddc1/details?installedFrom=PLAY_STORE&days=30

@ouchadam ouchadam added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems A-E2EE Z-Crash S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Apr 12, 2022
@ouchadam ouchadam self-assigned this Apr 12, 2022
@bmarty
Copy link
Member

bmarty commented Sep 7, 2022

Looks like the fix is not enough, see https://github.com/matrix-org/element-android-rageshakes/issues/42693. Reopening.

Maybe using CopyOnWriteArrayList or CopyOnWriteArraySet is a better solution.

@ouchadam
Copy link
Contributor Author

ouchadam commented Sep 12, 2022

@bmarty the ConcurrentModificationException crash in this rageshake is coming from 1.4.11

The crash occurred on 08-24 14:06:44.555 with 1.4.11 but the rageshake was sent at 2022-09-07T07:56:31 on 1.4.34

@ouchadam ouchadam assigned bmarty and unassigned ouchadam Sep 27, 2022
@danpe
Copy link

danpe commented May 18, 2023

Still experiencing the same here 🙋🏻‍♂️

@pepperoni666
Copy link

pepperoni666 commented May 18, 2023

Still experiencing the same here 🙋🏻‍♂️

We have a bit different stacktrace, but also believe that the reason must be the same.

java.util.ConcurrentModificationException
  at java.util.ArrayList$Itr.next([ArrayList.java:860](http://arraylist.java:860/))
  at [org.matrix.android](http://org.matrix.android/).sdk.internal.crypto.IncomingKeyRequestManager$processIncomingRequests$1$1.invokeSuspend(IncomingKeyRequestManager.kt:97)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
  at [kotlinx.coroutines.j0.run](http://kotlinx.coroutines.j0.run/)(DispatchedTask.kt:107)
  at java.util.concurrent.ThreadPoolExecutor.runWorker([ThreadPoolExecutor.java:1137](http://threadpoolexecutor.java:1137/))
  at java.util.concurrent.ThreadPoolExecutor$Worker.run([ThreadPoolExecutor.java:637](http://threadpoolexecutor.java:637/))
  at [java.lang.Thread.run](http://java.lang.thread.run/)([Thread.java:1012](http://thread.java:1012/))
  Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [s1{Cancelling}@c08de01, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@7adbee7]

@bmarty bmarty removed their assignment Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants