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

UIViewOperationQueue$UIOperation.execute() on a null object reference #22867

Closed
3 tasks done
Kelt opened this issue Jan 4, 2019 · 2 comments
Closed
3 tasks done

UIViewOperationQueue$UIOperation.execute() on a null object reference #22867

Kelt opened this issue Jan 4, 2019 · 2 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@Kelt
Copy link

Kelt commented Jan 4, 2019

Environment

React Native Environment Info:
System:
OS: macOS Sierra 10.12.6
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 1.86 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node
npm: 5.6.0 - ~/.nvm/versions/node/v8.9.4/bin/npm
SDKs:
Android SDK:
API Levels: 24, 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8

Description

Seeing multiple crashes in production app, can not reproduce. Seems like sometimes one (or multiple) UIOperation from batchedOperations in com.facebook.react.uimanager.UIViewOperationQueue are null at execution time, resulting in NPE ...

Reproducible Demo

As mentioned above, can not repro, not sure of the reason either. Stacktrace looks like this

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.uimanager.UIViewOperationQueue$UIOperation.execute()' on a null object reference at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:894) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1001) at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:46) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1061) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:977) at android.view.Choreographer.doCallbacks(Choreographer.java:791) at android.view.Choreographer.doFrame(Choreographer.java:723) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:965) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6651) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)

Code throws in this section, op.execute();

if (batchedOperations != null) {
    for (UIOperation op : batchedOperations) {
        op.execute();
    }
}

Ideally would like to understand, what might be causing this and whether this is bug on our side or in RN or a result of using third-party, like react-native-navigation

Suggested fix would be to perform a null check before calling execute on UIOperation, possibly iterating through batchedOperations and nonBatchedOperations Collections with Iterator and also removing those ops, in case of null ?

Discussion points

  1. figure out whether this is a bug in client code, or in RN, or a result of using RN with other 3rd party libs
  2. if bug is not in client code, suggest best solution to prevent crashes
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@kelset
Copy link
Contributor

kelset commented Mar 19, 2019

Hello there 👋 this issue seems to have a really low activity on it.

This is probably because OP managed to find a solution - also, it was most likely related their precise configuration. Because of this inactivity, we are closing it - but please feel free to comment and post a repro for version 0.59 and we'll gladly re-open it 🤗

That said, in your reporting you are neither providing a way to reproduce this issue nor important info like the full list of packages that you have. So I hope you can understand that it's borderline impossible for us to understand that this issue is actually caused by a bug of the main react-native library.

@kelset kelset closed this as completed Mar 19, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants