question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] ConcurrentModification exception for frameMetricsAggregator

See original GitHub issue

Environment

How do you use Sentry? sentry.io

Which SDK and version? Sentry react native. 3.0.0

Steps to Reproduce

Some of the app launches show following stack trace:

java.util.ConcurrentModificationException: null
    at java.util.ArrayList$Itr.next(ArrayList.java:860)
    at android.view.View.registerPendingFrameMetricsObservers(View.java:6363)
    at android.view.View.dispatchAttachedToWindow(View.java:17755)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3417)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1932)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1647)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7595)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
    at android.view.Choreographer.doCallbacks(Choreographer.java:800)
    at android.view.Choreographer.doFrame(Choreographer.java:713)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:974)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:6977)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:528)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:910)

Expected Result

No error

Here is my reasoning: RNSentryModule is the only package registering frameMetricsAggregator.

I think the temp fix would be to disable perf tracking via turning off enableAutoPerformanceTracking, but this seems like something worth looking into.

Actual Result

java.util.ConcurrentModificationException: null
    at java.util.ArrayList$Itr.next(ArrayList.java:860)
    at android.view.View.registerPendingFrameMetricsObservers(View.java:6363)
    at android.view.View.dispatchAttachedToWindow(View.java:17755)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3417)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1932)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1647)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7595)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
    at android.view.Choreographer.doCallbacks(Choreographer.java:800)
    at android.view.Choreographer.doFrame(Choreographer.java:713)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:974)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:6977)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:528)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:910)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jayshah-swiggycommented, Nov 10, 2021

Since it is a race condition, it is hard to reporduce, we get about 1 events for every 1k users. More over releasing with disabled auto perf tracking, fixed the issue for us. Zero issues since this disabling. Requesting you to investigate the same.

0reactions
marandanetocommented, Nov 10, 2021

thanks @jayshah-swiggy we will have a look

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle ConcurrentModificationException in Android
ConcurrentModificationException . First I tried to remove them by array_list_name.remove(i) , but it failed and some people were asked to use Iterator instead....
Read more >
ConcurrentModificationException - Android Developers
Fail-fast operations throw ConcurrentModificationException on a best-effort basis. ... Constructs a ConcurrentModificationException with no detail message.
Read more >
ac5fe7c617c66850fff75a9fce997...
diff --git a/annotations/external-annotations/android/support/annotation/annotations.xml ... ConcurrentModificationException; -import java.util.
Read more >
java.util.ConcurrentModificationException at ... - Issue Tracker
Jumping on this about #4 as I was about to open an issue about the lack of such annotation. With android Fragment 1.5.2...
Read more >
ConcurrentModificationException : r/Kotlin - Reddit
I'm getting stuck at this ConcurrentModificationException error. ... apk.sh, make reverse engineering Android apps easier!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found