-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Current jsc-android
prebuilt mismatch NDK version with template app
#36052
Labels
Platform: Android
Android applications.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Comments
cortinico
added
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
and removed
Needs: Triage 🔍
labels
Feb 3, 2023
I've created an issue on the |
cipolleschi
pushed a commit
that referenced
this issue
Feb 13, 2023
Summary: the current jsc-android is still built based on ndk r21, and react-native is now built based on ndk r23. the unwinder between r21 and r23 is incompatible (libgcc vs libunwind). if there's exceptions throwing from jsc, other react native libraries cannot catch these exceptions and cause runtime crash. this pr updates jsc-android to 235231.0.0 which is the same webkitgtk version as 235230.2.1 but only built by ndk r23. the jsc-android pr is from react-native-community/jsc-android-buildscripts#179. note that the jsc is based on ndk r23c and react-native is based on ndk r23b. the reason is that i cannot get jsc building successfully on r23b. hopefully r23b and r23c are abi safe. there is another crash from libjscexecutor when testing the new jsc-android. to fix the issue, i have to explicitly link libunwind.a from libjscexecutor.so. supposedly ndk r23 should help to link libunwind under the hood, i still not figure out why it doesn't. but after linking libunwind.a, i can get new jsc-android work successfully. ``` E/art ( 2669): dlopen("/data/app/com.test-1/lib/x86_64/libjscexecutor.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.test-1/lib/x86_64/libjscexecutor.so"... W/System.err( 2669): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.test-1/lib/x86_64/libjscexecutor.so"... W/System.err( 2669): at java.lang.Runtime.load(Runtime.java:331) W/System.err( 2669): at java.lang.System.load(System.java:982) W/System.err( 2669): at com.facebook.soloader.SoLoader$1.load(SoLoader.java:558) W/System.err( 2669): at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:110) W/System.err( 2669): at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:63) W/System.err( 2669): at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:91) W/System.err( 2669): at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772) W/System.err( 2669): at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24) W/System.err( 2669): at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:20) W/System.err( 2669): at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:363) W/System.err( 2669): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316) W/System.err( 2669): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94) W/System.err( 2669): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41) W/System.err( 2669): at com.test.MainApplication.onCreate(MainApplication.java:60) W/System.err( 2669): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011) W/System.err( 2669): at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:483) W/System.err( 2669): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518) W/System.err( 2669): at android.app.ActivityThread.access$1500(ActivityThread.java:144) W/System.err( 2669): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) W/System.err( 2669): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err( 2669): at android.os.Looper.loop(Looper.java:135) W/System.err( 2669): at android.app.ActivityThread.main(ActivityThread.java:5221) W/System.err( 2669): at java.lang.reflect.Method.invoke(Native Method) W/System.err( 2669): at java.lang.reflect.Method.invoke(Method.java:372) W/System.err( 2669): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) W/System.err( 2669): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) ``` fixes #36052 ## Changelog [ANDROID][FIXED] - Fixed jscexecutor crash on Android which is caused from NDK incompatibility Pull Request resolved: #36062 Test Plan: tested on [jsc-android instrumented test](https://github.com/react-native-community/jsc-android-buildscripts/tree/2.26.1/test) (based on react-native 0.71.2) Reviewed By: cipolleschi Differential Revision: D43040295 Pulled By: cortinico fbshipit-source-id: e0e5b8fb7faa8ee5654d4cde5f274bef4b517376
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this issue
May 22, 2023
Summary: the current jsc-android is still built based on ndk r21, and react-native is now built based on ndk r23. the unwinder between r21 and r23 is incompatible (libgcc vs libunwind). if there's exceptions throwing from jsc, other react native libraries cannot catch these exceptions and cause runtime crash. this pr updates jsc-android to 235231.0.0 which is the same webkitgtk version as 235230.2.1 but only built by ndk r23. the jsc-android pr is from react-native-community/jsc-android-buildscripts#179. note that the jsc is based on ndk r23c and react-native is based on ndk r23b. the reason is that i cannot get jsc building successfully on r23b. hopefully r23b and r23c are abi safe. there is another crash from libjscexecutor when testing the new jsc-android. to fix the issue, i have to explicitly link libunwind.a from libjscexecutor.so. supposedly ndk r23 should help to link libunwind under the hood, i still not figure out why it doesn't. but after linking libunwind.a, i can get new jsc-android work successfully. ``` E/art ( 2669): dlopen("/data/app/com.test-1/lib/x86_64/libjscexecutor.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.test-1/lib/x86_64/libjscexecutor.so"... W/System.err( 2669): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.test-1/lib/x86_64/libjscexecutor.so"... W/System.err( 2669): at java.lang.Runtime.load(Runtime.java:331) W/System.err( 2669): at java.lang.System.load(System.java:982) W/System.err( 2669): at com.facebook.soloader.SoLoader$1.load(SoLoader.java:558) W/System.err( 2669): at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:110) W/System.err( 2669): at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:63) W/System.err( 2669): at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:91) W/System.err( 2669): at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802) W/System.err( 2669): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772) W/System.err( 2669): at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24) W/System.err( 2669): at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:20) W/System.err( 2669): at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:363) W/System.err( 2669): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316) W/System.err( 2669): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94) W/System.err( 2669): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41) W/System.err( 2669): at com.test.MainApplication.onCreate(MainApplication.java:60) W/System.err( 2669): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011) W/System.err( 2669): at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:483) W/System.err( 2669): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518) W/System.err( 2669): at android.app.ActivityThread.access$1500(ActivityThread.java:144) W/System.err( 2669): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) W/System.err( 2669): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err( 2669): at android.os.Looper.loop(Looper.java:135) W/System.err( 2669): at android.app.ActivityThread.main(ActivityThread.java:5221) W/System.err( 2669): at java.lang.reflect.Method.invoke(Native Method) W/System.err( 2669): at java.lang.reflect.Method.invoke(Method.java:372) W/System.err( 2669): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) W/System.err( 2669): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) ``` fixes facebook#36052 ## Changelog [ANDROID][FIXED] - Fixed jscexecutor crash on Android which is caused from NDK incompatibility Pull Request resolved: facebook#36062 Test Plan: tested on [jsc-android instrumented test](https://github.com/react-native-community/jsc-android-buildscripts/tree/2.26.1/test) (based on react-native 0.71.2) Reviewed By: cipolleschi Differential Revision: D43040295 Pulled By: cortinico fbshipit-source-id: e0e5b8fb7faa8ee5654d4cde5f274bef4b517376
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Platform: Android
Android applications.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Description
As per this PR, version
250230.2.1
of thejsc-android
package was built with an old NDK version (r19c / 19.2.5345600). This conflicts with the current React Native template which uses NDK23.1.7779620
, which got updated in v0.71.0.These versions must match. If they don't any exception thrown by JSC wont be catchable by calling code (React Native) and will lead to crashes instead of runtime error.
One workaround is for end-users to override the version of
jsc-android
used byreact-native
in theirpackage.json
:Version
0.71.0
Output of
npx react-native info
Steps to reproduce
console.log(0n)
in the top of the index.js.Snack, code example, screenshot, or link to a repository
This is the stack on a crash from
console.log(0n)
on anarm64
emulator:The same crash on an
x86_64
emulator:The text was updated successfully, but these errors were encountered: