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

Solve the crash of Phones running Android 12 and Harmony 2 or later. #37927

Closed
wants to merge 1 commit into from

Conversation

leixd1994
Copy link

Summary:

Solve the crash of Phones running Android 12 and Harmony 2 or later.

Changelog:

@facebook-github-bot
Copy link
Contributor

Hi @leixd1994!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions
Copy link

Fails
🚫

📋 Verify Changelog Format - See Changelog format

Generated by 🚫 dangerJS against 2d86125

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2023
@@ -149,7 +148,7 @@ public long getBatchNumber() {
}

private class ConcurrentOperationQueue {
private final Queue<UIThreadOperation> mQueue = new ConcurrentLinkedQueue<>();
private final Queue<UIThreadOperation> mQueue = new LinkedBlockingQueue<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exactly does it solve the crash?

Also, what kind of crash? Is there an issue reported?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don`t know why this change can fix this issue. Maybe I just proposed this issue and need to further check

@rshest
Copy link
Contributor

rshest commented Jun 16, 2023

Could you please provide more context about the actual crash, and why is your PR supposed to fix it?

It's not immediately obvious to be that replacing ConcurrentLinkedQueue with LinkedBlockingQueue would fix the root cause, not a symptom (quite frankly, it looks more like the latter to me).

What is the intent/justification here?

@leixd1994
Copy link
Author

Hi. Below is the details for the crash
--------- beginning of crash
04-12 19:49:52.991 E/AndroidRuntime(14081): FATAL EXCEPTION: main
04-12 19:49:52.991 E/AndroidRuntime(14081): Process: com.test.selfcare, PID: 14081
04-12 19:49:52.991 E/AndroidRuntime(14081): com.facebook.react.bridge.JSApplicationIllegalArgumentException: Animated node with tag 2869 does not exists
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.animated.m.h(Unknown Source:83)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.animated.NativeAnimatedModule$f.a(Unknown Source:38)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.animated.NativeAnimatedModule.executeAllOperations(Unknown Source:75)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.animated.NativeAnimatedModule.access$400(Unknown Source:0)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.animated.NativeAnimatedModule$p.a(Unknown Source:8)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.w0$t.execute(Unknown Source:8)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.w0$a.run(Unknown Source:135)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.w0.U(Unknown Source:53)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.w0.s(Unknown Source:0)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.w0$j.c(Unknown Source:31)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.uimanager.f.a(Unknown Source:0)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.modules.core.g$d.a(Unknown Source:46)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.facebook.react.modules.core.a$a$a.doFrame(Unknown Source:2)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1447)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.view.Choreographer.doCallbacks(Choreographer.java:1165)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.view.Choreographer.doFrame(Choreographer.java:1049)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1417)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.os.Handler.handleCallback(Handler.java:966)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.os.Handler.dispatchMessage(Handler.java:110)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.os.Looper.loopOnce(Looper.java:205)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.os.Looper.loop(Looper.java:293)
04-12 19:49:52.991 E/AndroidRuntime(14081): at android.app.ActivityThread.main(ActivityThread.java:9596)
04-12 19:49:52.991 E/AndroidRuntime(14081): at java.lang.reflect.Method.invoke(Native Method)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586)
04-12 19:49:52.991 E/AndroidRuntime(14081): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1204)


Output of npx react-native info
System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Memory: 12.29 GB / 31.84 GB
Binaries:
Node: 14.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google API
s Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google TV Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6858069
Visual Studio: Not Found
Languages:
Java: 1.8.0_262 - C:\Program Files\Huawei\jdk1.8.0_262\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.64.2 => 0.64.2
react-native-windows: Not Found
npmGlobalPackages:
react-native : Not Found

System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Memory: 12.29 GB / 31.84 GB
Binaries:
Node: 14.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google API
s Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google TV Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6858069
Visual Studio: Not Found
Languages:
Java: 1.8.0_262 - C:\Program Files\Huawei\jdk1.8.0_262\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.64.2 => 0.64.2
react-native-windows: Not Found
npmGlobalPackages:
react-native : Not Found

@rshest
Copy link
Contributor

rshest commented Jun 16, 2023

Hey @leixd1994,

Thanks for providing the details of the crash you observed.

Did you test your fix before/after on the latest trunk of the React Native core code?

Judging by the entries in the callstack you provided, the code that was executed is an old one, and it doesn't correspond to what is currently there in the trunk.

It very well may be that the problem has been fixed since then.

rshest added a commit to rshest/react-native that referenced this pull request Jun 16, 2023
Summary:
# Changelog:
[Internal] -

Was looking at some [crash report](facebook#37927) on Github and noticed that error message has a grammar error.

Searching the code revealed three more, all in Animated.

This calms down my OCD :)

Differential Revision: D46792795

fbshipit-source-id: 753692032d976026c430c40d9bd16f6911870911
Copy link
Contributor

@rshest rshest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify whether this really fixes anything (as from the looks at the crash report and the code change it really doesn't seem like it would), and please do it on the latest trunk code, as the reported crash appears from an old code version.

rshest added a commit to rshest/react-native that referenced this pull request Jun 16, 2023
Summary:
Pull Request resolved: facebook#37930

# Changelog:
[Internal] -

Was looking at some [crash report](facebook#37927) on Github and noticed that error message has a grammar error.

Searching the code revealed three more, all in Animated.

This calms down my OCD :)

Reviewed By: sammy-SC

Differential Revision: D46792795

fbshipit-source-id: de54fe79060edf79b76b0b2070b8dcebcd1bc998
facebook-github-bot pushed a commit that referenced this pull request Jun 16, 2023
Summary:
Pull Request resolved: #37930

# Changelog:
[Internal] -

Was looking at some [crash report](#37927) on Github and noticed that error message has a grammar error.

Searching the code revealed three more, all in Animated.

This calms down my OCD :)

Reviewed By: sammy-SC

Differential Revision: D46792795

fbshipit-source-id: 5fcf78e38d5d1540d3699e81bbf4ba036fb5c74d
@nitish24p
Copy link

@rshest Do you think this can be an internal android bug Refer to this: https://issuetracker.google.com/issues/261481042

And the above change can be a fix?

@freeboub
Copy link

I am just reviewing this change, if the real root cause is ConcurrentLinkedQueue, on release 0.71.5 It is also used in MountItemDispatcher and SurfaceMountingManager.
Would it make sens to also change these implementations ?

@reeserlueckw
Copy link

how to change ReactAndroid native source code when herms Enabled?

@freeboub
Copy link

how to change ReactAndroid native source code when herms Enabled?

You need to enable building from source in your repo. There is a section in soc "build from source"

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 13, 2023
@javache javache closed this Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants