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

Android crash due to ArrayIndexOutOfBoundsException in Pool of DynamicFromMap #19141

Closed
2 of 3 tasks
alexdeleon opened this issue May 5, 2018 · 3 comments
Closed
2 of 3 tasks
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@alexdeleon
Copy link

alexdeleon commented May 5, 2018

I getting this exception every now and then in an Android production App. I have not been able to find a systematic way to reproduce it, but It always occurs while setting some style property of a View. For instance:

Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'paddingTop' in shadow node of type: RCTView
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:116)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154)

By inspecting the code it seems like the object pool in com.facebook.react.bridge.DynamicFromMap is accessed from multiple treads leading to its internal variable mPoolSize become -1 in android.support.v4.util.Pool

The exception is the following:

Caused by java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
       at android.support.v4.util.Pools$SimplePool.release(Pools.java:120)
       at com.facebook.react.bridge.DynamicFromMap.recycle(DynamicFromMap.java:42)
       at com.facebook.react.uimanager.LayoutShadowNode.setPaddings(LayoutShadowNode.java:612)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:110)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58)
       at com.facebook.react.uimanager.ReactShadowNode.updateProperties(ReactShadowNode.java:273)
       at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:205)
       at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:243)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:154)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
       at java.lang.Thread.run(Thread.java:762)

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.49.3 => 0.49.3

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label May 16, 2018
@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@augustl
Copy link
Contributor

augustl commented Oct 24, 2018

This seems to have been fixed (and not currently released yet): #17842

@facebook facebook locked as resolved and limited conversation to collaborators May 16, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants