You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not security related and can safely be disclosed publicly on GitHub
Java version
JDK11
Android version
Android13,14,12,10,11
Android SDK version
16.2.0
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
The program is normal
Expected results
No crash
Actual results
Program startup crashes Fatal Exception: java.util.ConcurrentModificationException: at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:760) at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:782) at com.facebook.internal.FetchedAppGateKeepersManager.getGateKeepersForApplication(FetchedAppGateKeepersManager.kt:165) at com.facebook.internal.FetchedAppGateKeepersManager.getGateKeeperForKey(FetchedAppGateKeepersManager.kt:177) at com.facebook.internal.FeatureManager.getGKStatus(FeatureManager.kt:107) at com.facebook.internal.FeatureManager.isEnabled(FeatureManager.kt:54) at com.facebook.internal.FeatureManager.isEnabled(FeatureManager.kt:54) at com.facebook.internal.Utility.setAppEventAttributionParameters(Utility.kt:578) at com.facebook.applinks.AppLinkData.fetchDeferredAppLinkFromServer(AppLinkData.java:143) at com.facebook.applinks.AppLinkData.access$000(AppLinkData.java:36) at com.facebook.applinks.AppLinkData$1.run(AppLinkData.java:131) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)
Steps to reproduce
Unable to reproduce
Code samples & details
AfterintegratingtheSDK, callingtheAppLinkData.fetchDeferredAppLinkDatamethodintheApplication's oncreate method, 5K+ crashes were observed on firbase. However, the crash cannot be reproduced locally.
Thefollowingismydebuggingprocess:
1.BecauseIcalledAppLinkData.fetchDeferredAppLinkDataintheKotlincoroutine, Iamnotsurewhetherthereisanasynchronousconcurrencyprobleminamulti-threadedenvironment2.TheFetchedAppGateKeepersManagerclassinthesourcecode, thefollowingcode:
valoutput: MutableMap<String, Boolean> = HashMap()
valjsonObject: JSONObject = fetchedAppGateKeepers[applicationId] ?: JSONObject()
valjsonIterator = jsonObject.keys()
while (jsonIterator.hasNext()) {
valkey = jsonIterator.next()
output[key] = jsonObject.optBoolean(key)
}
Printingthelog, Ifoundthatevenwhenmultiplethreadsaccessedandmodifiedatthesametime, itdidnotaffecttheiterationhere. SoIamwonderingwhatotherpossiblepointsmaycausethiserror?
3.IsitpossiblethatcacheListisemptyundercertaincircumstances? IsitpossiblethattheSDKinitializationandtheAppLinkData.fetchDeferredAppLinkDatamethodareexecutedsimultaneouslyundercertainextremeconditionswhentheAppisstarted?
The text was updated successfully, but these errors were encountered:
Can you explain to me what conditions may trigger this error when the getGateKeepersForApplication method is running? From my current debugging log observation, there is no problem even when accessing and modifying the fetchedAppGateKeepers variable in a multi-threaded environment
Checklist before submitting a bug report
Java version
JDK11
Android version
Android13,14,12,10,11
Android SDK version
16.2.0
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
The program is normal
Expected results
No crash
Actual results
Program startup crashes
Fatal Exception: java.util.ConcurrentModificationException: at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:760) at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:782) at com.facebook.internal.FetchedAppGateKeepersManager.getGateKeepersForApplication(FetchedAppGateKeepersManager.kt:165) at com.facebook.internal.FetchedAppGateKeepersManager.getGateKeeperForKey(FetchedAppGateKeepersManager.kt:177) at com.facebook.internal.FeatureManager.getGKStatus(FeatureManager.kt:107) at com.facebook.internal.FeatureManager.isEnabled(FeatureManager.kt:54) at com.facebook.internal.FeatureManager.isEnabled(FeatureManager.kt:54) at com.facebook.internal.Utility.setAppEventAttributionParameters(Utility.kt:578) at com.facebook.applinks.AppLinkData.fetchDeferredAppLinkFromServer(AppLinkData.java:143) at com.facebook.applinks.AppLinkData.access$000(AppLinkData.java:36) at com.facebook.applinks.AppLinkData$1.run(AppLinkData.java:131) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)
Steps to reproduce
Unable to reproduce
Code samples & details
The text was updated successfully, but these errors were encountered: