react-native: App Crash on Android OS 6 Samsung Galaxy S7 SM-G930FD (JSC Crash) 64 bit support A/libc: Fatal signal 11 (SIGSEGV)
Bug Report Crashed on launch Crashed with only this error log traced on android logcat A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 20217.
To Reproduce
react-native run-android
and navigate to second screen from initial route through stack navigator. I am using React-Navigation 3.6
App crashes as soon as I start going into react-navigation
and crashing in Samsung S7 64 bit CPU
device, working fine in other android devices which I am using.
Expected Behavior just to work in a stable manner. like in earlier react-native version 0.58
Environment React Native Environment Info: System: OS: Mac OS mojave 10.14 Binaries: npm: 6.4.1 Android Studio: Version 3.2.1 Android 6.0.1 (real device: Samsung S7 SM-G930FD) React Native v0.59.3
Temporary Workaround: When I removed 64 bit ndk filters “arm64-v8a”, “x86_64” from ndk abiFilters in defaultConfig block of buidl.gradle by provide only 32 bit support. It works fine.
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" -> change to
abiFilters "armeabi-v7a", "x86"
}```
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 91
- Comments: 190 (48 by maintainers)
Commits related to this issue
- fix: remove 64bit builds to fix Galaxy S7 issue with Android v7 See https://github.com/facebook/react-native/issues/24261 — committed to digidem/mapeo-mobile by gmaclennan 5 years ago
- fix: remove 64bit builds to fix Galaxy S7 issue with Android v7 (#122) * fix: remove 64bit builds to fix Galaxy S7 issue with Android v7 See https://github.com/facebook/react-native/issues/24261 ... — committed to digidem/mapeo-mobile by gmaclennan 5 years ago
- https://github.com/facebook/react-native/issues/24261 — committed to keybase/client by chrisnojima 5 years ago
- https://github.com/facebook/react-native/issues/24261 (#17806) — committed to keybase/client by chrisnojima 5 years ago
- Upgrade jsc-android to r245459 and fix crash on Samsung S7 Edge (#25426) Summary: Upgrade bundled jsc-android that should fix the native JSC crash addressed for https://github.com/facebook/react-nati... — committed to facebook/react-native by Kudo 5 years ago
- upgrade react-native: 0.59.9 > 0.59.10 This is due to issues with 64 bit builds, for more details: https://github.com/facebook/react-native/issues/24261 Signed-off-by: Jakub Sokołowski <jakub@status... — committed to status-im/status-mobile by jakubgs 5 years ago
- upgrade react-native: 0.59.9 > 0.59.10 This is due to issues with 64 bit builds, for more details: https://github.com/facebook/react-native/issues/24261 Signed-off-by: Jakub Sokołowski <jakub@status... — committed to status-im/status-mobile by jakubgs 5 years ago
- upgrade react-native: 0.59.9 > 0.59.10 This is due to issues with 64 bit builds, for more details: https://github.com/facebook/react-native/issues/24261 Signed-off-by: Jakub Sokołowski <jakub@status... — committed to status-im/status-mobile by jakubgs 5 years ago
- upgrade react-native: 0.59.9 > 0.59.10 This is due to issues with 64 bit builds, for more details: https://github.com/facebook/react-native/issues/24261 Signed-off-by: Jakub Sokołowski <jakub@status... — committed to status-im/status-mobile by jakubgs 5 years ago
- Mobile: Fixes #1764 (maybe): Upgrading React-Native to 0.59.10 to try to fix crash in certain Samsung phone due to 64-bit version See also: https://github.com/facebook/react-native/issues/24261#issu... — committed to laurent22/joplin by laurent22 5 years ago
- fix crash on some android 6 devices see https://github.com/facebook/react-native/issues/24261#issuecomment-525443006 — committed to bemaverick/react-native-phone-input by bemaverick 5 years ago
- Upgrade jsc-android to r245459 and fix crash on Samsung S7 Edge (#25426) Summary: Upgrade bundled jsc-android that should fix the native JSC crash addressed for https://github.com/facebook/react-nati... — committed to M-i-k-e-l/react-native by Kudo 5 years ago
@hramos @mkonicek As of now we can conclude that this seems to be an issue with latest RN 0.59 release, affecting android builds running on
Samsung S7
,S7 Edge
after we provided support forarm64-v8a
,x86_64
, removing them frombuild.gradle
does not crash the app, which could potentially affect apps going live after1 August 2019
as per Google Play 64 bit support policy. We would like you guys to draw some attention to it, please?👋 everyone.
We hear you all, and because of the issues so many of you are having we did one last 0.59.10 patch release to provide you with the new version of the JSC.
Huge thanks to @Kudo for his work on back-porting this to 0.59.
We will not do other 0.59 releases for the foreseeable future, as it is a challenging work and even harder because we are also working on 0.60 (which will have the new JSC too!).
I’m going to close this as the main core issue has been tackled, but I’d suggest to open a new one for other crashes that you may be experiencing after 0.59.10.
I tried the tombstone logging @j-wang mentioned but I’ve never really used that and it was an immense file which was hard to read, after searching for a while I didn’t really seem to find a readable root cause.
After taking the advice of @armenbadalyan, I started wondering if it just wasn’t something silly in the start of our app and sure enough when removing the first component’s UI, I noticed that the app was running again, stable. So after more digging I noticed that a specific component was given issues where an Image was rendered.
In that component there is a chance that we pass
null
as thesource
variable on areact-native
Image
. Took me a while to look for this an no real clear errors but this finally fixed everything for me and it’s running on all our test devices. Still no clue why it didn’t fail on our other test device…Might help other people to simplify the first component of their app to make sure it’s not crashing on that code.
TL;DR: This is probably completely off-topic by now, but to whom it concerns: DON’T USE
null
AS THEsource
VARIABLE OFImage
, it doesn’t work on all devices. 😅Dears,
Here is probably my last try - to use newer WebKit version.
@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
is based on WebKitGTK 2.24.2, with baseline JIT but no DFG JIT. A notable change is that newer WebKit changed JIT bytecode format. x86’s JIT is not supported and armeabi-v7a JIT support is from community (Thanks Igalia). Since the crash happens only on arm64, the new version is still worth to try.The detailed steps to integrate this version is in https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17#file-steps_for_webkitgtk_2_24_2-md. notable change is that
241213 -> 245459
from previous JSC version and make sure to have245459.9000.0
in adb log. Please help to verify this experimented JSC. Hopefully we have luck this time. 🤞@benoitdion thanks for your encourage ❤️
Dears,
Just to update that with @kmagiera’s help, my patch has been published as ‘jsc-android@245459.0.0’. I’ve sent https://github.com/facebook/react-native/pull/25426 to have the updated JSC into RN. And @kelset also have it into RN 0.60 RC. Hopefully we could finally fix and close this issue. Shout out to people here especially for the help to verify my experimented versions back and forth. We are so called RN community!
Dears,
We’ve published the no-JIT JSC into jsc-android npm and I revised my previous gist to use
jsc-android@next
. https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17 Hopefully to fix all the crash problems. If there aren’t significant performance drop, we will propose the no-JIT version as @latest version officially and send a PR to have it builtin in newer RN.publishing 64bit split build I’m also getting this crash on launch on Galaxy S7 & Galaxy S7 Edge with Android 7.0 android vitals showing: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) WTFCrash backtrace: #00 pc 00000000007e048c /data/app/com.mosko.bus-1/lib/arm64/libjsc.so (WTFCrash+16) #01 pc 00000000000be650 /data/app/com.mosko.bus-1/lib/arm64/libjsc.so (_Z16WTFCrashWithInfoiPKcS0_i+24) #02 pc 0000000000489f2c /data/app/com.mosko.bus-1/lib/arm64/libjsc.so (operationLinkDirectCall+1120) #03 pc 000000000019e27c <anonymous>
on Crashlytics for those devices I’m getting: Fatal Exception: com.facebook.react.common.c Invariant Violation: Resuming work not yet implemented.
the workaround of only providing 32bit build is solving this for now
Removing 64 bit is not a solution as per
Google Play 64 bit support policy.
It could potentially affect apps going live after1 August 2019
. We would like to have proper solution for this issue. @hramos any update on this ? Please draw some attention.Some more update here: I really doubt if the native crash happens easily on S7 edge, there should be other applications faced such problems. Gotcha! Google Play Service with Text API had this problems but no OSS fix Mono found a crash issue on S7 Exynos bit.LITTLE arch and here is the fix.
JavaScriptCore did use
__clear_cache
in ARM64Assembler. I will have another experimented build to patch __clear_cache later this week.Dears,
I am so sorry that the performance acted bad for the no-JIT version. And sorry I don’t have solutions right now. It is hard for me to troubleshoot such issue that I was unable to reproduce. Hopefully someone from the community could help to dig the problem.
JSC for RN is OSS at https://github.com/react-native-community/jsc-android-buildscripts. It supports to enable debug build by uncommenting line in https://github.com/react-native-community/jsc-android-buildscripts/blob/master/scripts/start.sh#L10. Attaching gdb or lldb to debug natively, maybe there will be some clue. The crash might violate some RELEASE_ASSERT in https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.22.6/Source/JavaScriptCore/jit/JITOperations.cpp#L1067, but not sure how the problem going to the state.
@benoitdion yes, but it is a workaround, an official fix published as 0.59.10 would be better.
Repeating what Kudo said, just more giving context and summarizing the previous content of this issue (since it’s probably hard to sort through so many comments at this point):
If you have 0.59.9 or below, this is a verified problem with the old JSC. It’s the subject of hundreds of comments above (and in other issues). The problem isn’t exclusive to 64-bit, but most often occurs with 64-bit.
0.60+ has various breaking changes, especially on Android.
If you don’t want to go through that, try 0.59.10 since it has the fix (as described above) integrated directly in the version/build—and it seems to fix the problem for the majority of cases.
There are still cases where there are problems for certain phones (which I’ve encountered too), see #25494—if you have this, I’d suggest posting your stacktraces to that open issue there. However, if you’re saying you have 0.59.9, you can probably fix your problem by going to 0.59.10.
if i use below app crashes and accepted by google play store ndk { abiFilters “armeabi-v7a”,“arm64-v8a”,“x86”,“x86_64” } if i use below app is working but not accepted by google play store ndk { abiFilters “armeabi-v7a”, “x86” }
please any one help me solving
I agree with some comments before it would be better to have a 0.59.10 with this fix because it is going to be harder to upgrade to 0.60 @Kudo @kelset @grabbou @turnrye
We had this exact issue on 0.59.1 and were able to fix it by doing the following:
jsc-android
to the “dependencies” section in yourpackage.json
:then run
npm install
oryarn
(depending on which npm client you use) in order for the new dependency to be installed innode_modules
android/build.gradle
file to add the new local maven repository packaged in thejsc-android
package to the search path:build.gradle
file located inandroid/app/build.gradle
to add the JSC dependency. Please make sure the dependency is before the React Native dependency.build.gradle
file located inandroid/app/build.gradle
to use first matched JSC library.It 'd be awesome if we can get it in 0.59.x 0.60 has a lot of breaking changes with AndroidX & external libs.
Any update on this issue?
Hi, everyone, I hava same issue in 0.59.5, remove android:screenOrientation=“portrait” in AndroidManifest.xml. It works for me.
Also happening on 0.58.5. Galaxy S7. Android 6.0. Setting it to 32 bit build is also not working.
The experimented builds that fixed
__clear_cache
have ready.The steps are same as before but only to use different npm dependency.
yarn add '@kudo-ci/jsc-android@241213-fix-clear-cache-dfg'
and confirmed adb logcat with version241213.8000.0
(ref source code here)yarn add '@kudo-ci/jsc-android@241213-fix-clear-cache-no-dfg'
and confirmed adb logcat with version241213.9000.1
(ref source code here)I am sorry I cannot verify the crash issue again but only to verify basic functionalities. Please help to test the two experiment JSC if possible. Thank you all so much and wish us good luck this time.
cc @AndrewJack @MalcolmScruggs @tijs @ishantsagar @timhatch
Having the same issue with Samsung Galaxy S7, on Android 7
@ntorion on our project we still see these crashes on Samsung s7 with react-native 0.59.8 i’m afraid.
@nadavmos The crash is not related to
react-navigation
, in-fact the app is crashing on a fresh RN Project created via react-native init.@timhatch Awesome! Specially thanks for your verficiation. Will push the JSC changes into RN soon.
@dishantwalia Yes, ongoing. Thank you.
Dears,
I had two experimented JSC versions, please try if these could fix crashes for you. A brief steps here: https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17
One experimented version is to disable one kind of JIT. And the other one disable JIT totally from @matthargett recommended. If the two versions will fix crash for you, please also feedback to us the overall performance & TTI as mentions in my gist.
@Kudo This is the log I got running those commands on a fresh project on RN
0.59.8
I tried building debug and release builds and compiling the jsc myself by the logs looked the same in each case.I have a S7 at hand and would be happy to try running anything else to try and figure this out.
0.59.10 didn’t solve it for me either. I can’t upgrade to 0.60.x because some of my dependencies won’t work. Got it to compile on Hermes but saw a huge spike in ANRs (Thank God for staged rollout). Still sitting on the Play Store with RN version 0.57.8 but I can’t update my app anymore because of the 64 bit requirement. Pretty frustrated and trying to decide whether to just rebuild the entire app with another framework.
My app still crashes on Meizu M5s M612H Android OS 6 with RN-0.59.10. I’ve created new issue as @kelset suggested.
Hi @benoitdion ,
Yes, it is possible to consume even though is not in the main library, in fact, I followed these instructions https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17 . and it worked
But I don’t think this is a permanent solution and neat because of the many things you need to add to your Android project, I think a hotfix in main RN would be more convenient from a developer point of view and it solves many crashing issues on Android apps
@Kudo No problems with
@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
. No application hangs or crashes.@Kudo
@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
works fine!Can confirm that the crash that was happening with RN v0.59, upon using the above JSC, has disappeared. Tested in Google Nexus 6, others will be confirmed after roll out.
Thanks!!
@Kudo Here are my findings:
The Samsung S5 is
armeabi-v7a
. I’ve tried all 4 alternatives you have provided, and the one without jit seems to be the only crash free one. Disabling dfg reduces the crash rate quite a lot but I could still crash it.I’m also testing on a Pixel XL (
arm64-v8a
) and haven’t encountered any crashes yet onkudo-ci/jsc-android@241213-fix-clear-cache-no-dfg
but the crash is hard to reproduce on a high end devices as the root cause seems to be low memory pressure.To sum up:
@kudo-ci/jsc-android@241213-no-jit
: This is crash free on both devices@kudo-ci/jsc-android@241213-fix-clear-cache-no-dfg
: This does crash on low end devices, couldn’t reproduce on high end ones@kudo-ci/jsc-android@241213-fix-clear-cache-dfg
: This crashes more frequently than the other build on a low end device. (still better than the stock RN 59 jsc)@kudo-ci/jsc-android@241213-no-dfg-jit
: This crashed on low end devices as well, I haven’t tested on a high end.Even the build without jit is considerably faster than the stock JSCs, so we are planning to use
@kudo-ci/jsc-android@241213-no-jit
and we’ll be testing it more to ensure it’s production ready.Thanks a lot for all the help by the way. Let me know if I could be of any help
Hi, I am helping with the JSC crash issue and also a collaborator of jsc-android-buildscripts. RN 0.59 JSC is in fact from jsc-android-buildscripts.
To troubleshoot the crash issue, we need the crash backtrace. Hopefully, please follow the steps to below get backtrace and post here. I could then follow up to find potential solutions.
Install ndk-build and execute commands:
It seems a lot of crash comes from Samsung S7. Unfortunately, I have no S7 at hand. Hopefully to get some useful information to go further troubleshooting.
Have the same issue here,
We can’t upgrade to 0.60 because react-native-maps doesn’t support AndroidX yet, can’t push our updates to 0.59.X because S7 & S7 plus crashes.
This is really an issue for businesses depends on react-native
Is there any workaround for this?
@Kudo Please push that fix in
jsc-android-buildscripts
and publish a version. So we can roll out this in our production apps https://github.com/react-native-community/jsc-android-buildscripts.Thanks @Kudo for all the hard work! 241213.2.0 seems to have resolved the crashes for us. Unfortunately, the performance impact is pretty significant. On low-end devices on some of our busier screens we’ve seen js fps decrease by 20-30%.
@Kudo I tried out both
@kudo-ci/jsc-android@241213-fix-clear-cache-dfg
and@kudo-ci/jsc-android@241213-fix-clear-cache-no-dfg
on a basic project running React-Native0.59.8
and on both versions the crash is not happening. I tested on a Samsung Galaxy S7 on android 7.0:@dudusotero use @Kudo instruction https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17
In my case I was using 0.59.8, I’ve since then reverted to 0.57.8 since nothing else seemed to work. This bug is particularly bad because it causes the app to crash immediately upon opening. My app took quite a haircut in the reviews.
These devices have a signal 11 crash but it just shows a memory location.
General Mobile GM8 Go - Android 8.1 Motorola Moto E - Android 7.1 Samsung Galaxy A6+ - Android 8.0 Samsung Galaxy Grand Prime Pro - Android 8.0 Samsung Galaxy Tab S2 - Android 8.0 Samsung Galaxy J5 Prime - Android 8.0 Samsung Galaxy J6 - Android 8.0 Samsung Galaxy J7 Max - Android 8.1
These devices seem to show up with an error that looks like ==/lib/arm64/libjsc.so. I don’t know enough about the inner workings to know what that means, but hopefully it helps.
Huawei Y9 - Android 8.1 Oppo RMX1811 - Android 8.1 Oppo R15 - Android 8.1 Motorola Moto X - Android 9.0 Nokia 3 - Android 8.1 Samsung Galaxy Note9 - Android 9.0 Samsung Galaxy S9 - Android 9.0 Xaomi Redmi Note 5 Pro - Android 8.1
@quietbits, most of the logs related to these issues are not super helpful, but to get it out:
Look for when the crash occurs using
adb logcat
—it’ll look something like this (not exactly, since I just extracted this from the top of the log, but it shows an exerpt which is why I’m pointing it out):It’ll also usually say that the log is written to a “tombstone.”
To get the tombstone off, use
adb bugreport ./MySuperSpecialBugReport
with the latter part obviously being the path you want it in.It’ll get it off as a zip, and you can unzip it, navigate (on most devices) to:
./MySuperSpecialBugReport/FS/data/tombstones
and then you can open up the tombstone with your text editor.Again, just given the nature of these crashes, they’re not super informative. At least with ours, they’re usually with mqt_js, and at a low pointer address. They also still occur (though less and less weirdly/unpredictably) with 32-bit only apks.
===
@Kudo—definitely looking forward to being able to try out different JSCs more easily and see what it does. This has been a real pain point so far in upgrading to 0.59 with super non-deterministic and unpredictable crashes (that also only occur on certain devices… sometimes).
This issue is already identified on the webkit repo. I have commented there when I discovered this issue months ago: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/327#issuecomment-436781890
It would be great to coordinate the efforts.
Note: at Youi we use RN in a non-standard way. We build our own 64-bit JSC, so we got this issue far earlier, prior to 0.58.
I agree with @adnkh, we cant upgrade to AndroidX now, but we need to solve the 0.59 crashes.
Tested on a Nexus 5 and Samsung Tab E among others.
@kudo worst case scenario the jit should only be disabled for the 64bit version, only 64bit capable devices are crashing
@Kudo
@Kudo I had two observations here, as also mentioned in your gist
@kudo-ci/jsc-android@241213-no-dfg-jit
dependency, when using one of our production app for few minutes.@kudo-ci/jsc-android@241213-no-jit
dependencyas of now
and TTI remains the same/unnoticeable with respect to previous builds.Kudo, will your pull request be sufficient enough to fix this, as I noticed the hanging of the app when tested against
no_dfg_jit
To get the symbolicated backtrace, I used to combine adb logcat and ndk-stack For example, targeting RN 059 stock JSC (which is jsc-android@236355.0.0) and arm64-v8a ABI.
@AndrewJack The new release just for WebKit security patches & removing libc++_shared.so for https://github.com/facebook/react-native/pull/24672. I don’t think these will fix the crash issues.
AFAIK, there are various JSC crash types. Some are from operationLinkDirectCall as this issue reported and some are NPE as https://github.com/react-native-community/jsc-android-buildscripts/issues/84. Most of them are related to JIT. JIT crash path is hard to reproduce in-house and hard to troubleshoot as well. I have some potential fixes but not quite sure if those will truly solve the crash issue.
One of fixes is to disable DFG_JIT.
There is also a fix from upstream related operationLinkDirectCall
Newer JSC (WebKitGTK 2.24) includes a lot of JIT changes. Worth to try if upgrade helps.
IMO, if in-house reproduce is not possible, an alternative is to deliver experimented build.
My plan is to make upgrade JSC easier, simply
yarn add jsc-android@experiment
. This should happen at RN 0.60. With this mechanism, at least we could be a step ahead to fix crash issues.On the other hand, it would help if there are reliable reproduce code & environment. For example, there is a repo from react-native-navigation. It helps much. https://github.com/react-native-community/jsc-android-buildscripts/issues/84#issue-407898908
As of our gradle default config we do not even support 64bit and the crashes happen nevertheless.
@nadavmos, I’m not using
react-navigation
. This very well maybe the same issue as #24260 since that issue is also affecting 0.59 with Samsung S7 on Android 7.0Can confirm that this solved the issue for us. 64 bit builds with
react-native-v8
on0.59.10
are not crashing anymore and we can finally push updates again on Google Play. Thank you!React Native 59.10 does not solve it for us either. App still crashes on first launch.
any s7 owners had the chance to test this issue with Hermes?
+1 for us, getting it into 0.59.x would solve a lot of problems for our apps.
Don’t really want to head into 0.60 because of the Android X support in libraries so far.
The pickFirst for JSC hasn’t worked for us, must be one of our native libs causing an issue but it seems to always pick the rn internal version. (Clean project worked though, so must be one of our deps causing it)
Kirk
On Sat, 29 Jun 2019, 19:35 Anurag Dadheech, notifications@github.com wrote:
Thanks @Kudo
I previously had react-native 0.58.3, I see people mention 0.59 all the time, so I decided also to update. The combination of having 0.59.0 and @kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg seemed to do the trick for me.
I can no longer produce the crash.
I have been also getting the Galaxy S7 crash after updating RN from 0.58.6 to 0.59.9.
The current npm version of
jsc-android
still makes the app crash, but using@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
and JSC version245459.9000.0
fixed the crash for me on S7.@Kudo I’ve rebuilt a version of a previously-affected app with the same build configuration as in previous tests but using
@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
. No crashes or hangs so far - I’ll see if I can stress the app across the weekend and report back if I encounter any issues.Thanks for all your work on this and
jsc-android-buildscripts
@Kudo. It’s been amazing following your progress! Is there anything we (the community watching this issue) can do to help? I believe @tuncaulubilge had a mostly stable repro case.Maybe the internal facebook react-native team has jsc experts?
For any Googlers who are upgrading their RN project to 59.x, make sure that in
android/app/build.gradle
-> android { defaultConfig { versionName } } is not getting matched with your react-native-code-push specified version.I struggled around three days for the same issue and later found out that my upgraded React Native project at v59.3 was getting updated by code-push which has React Native v54.7
This must not be the case for 90% of the people. But for some like me, it can save time.
After that thanks to @Kudo. Fixed the crash issues.
I can also confirm the crashes are gone but we are also seeing quite poor performance in lower end devices. Gotta say it’s extremely disappointing considering we’ve been waiting to upgrade to RN58/RN59 for the more modern JSC.
Thanks @Kudo disable-jit works for us like a charm !!!
@tido64 TTI has no much differences. Binary size reduces about 1MB from no_dfg version. Memory reduces about 48%. I’ve sent a PR to disable JIT totally and there is measurement result. https://github.com/react-native-community/jsc-android-buildscripts/pull/108
@timhatch Good to hear fixing __clear_cache helps a little. I still doubt the root cause is from big.LITTLE, but I didn’t find other JSC code to cause problems yet. Both Samsung S5 and S7 are big.LITTLE and the two CPU set have different cache line size. That maybe the reason why I was unable to reproduce crash on Samsung Note 5, that its two CPU set cache line size are both 64B. Not sure if it is possible for OS scheduler and JSC to transition between big <-> LITTLE CPU at runtime. If it is true, the problem may especially happens at that time.
@tuncaulubilge That’s curious for me. You could check my PR, the no-jit version is slower than stock RN058 JSC. That’s also what I felt during measurement. Maybe the benchmarks are extreme cases and pretty not like a RN app used to be. BTW, I did see the binary size & memory size reduces from no-jit version. These two benefits and crash free are more reasonable to me.
We are using Expo v32 to build our app and we are seeing this error across Android versions and devices.
@matpaul @Kudo i can confirm that this experimental build of js core seems to fix the issue for us as well (tested on Samsung s7).
@MalcolmScruggs Nice to hear both the experimented versions fix the crash for you. I am thinking to disable DFG_JIT, at least the JIT option is aligned with old JSC.
My suggestion is to recompile the JSC with JIT disabled. It’s possible the security mechanisms in the OS interfere with the JIT’s operations in some unpredictable way.
@SpertsyanKM The crash occurs at the ndk level. You won’t see the crash in the firebase console, unless you add the Crashlytics NDK library. https://docs.fabric.io/android/crashlytics/ndk.html
As you’ve found the
Thread.setDefaultUncaughtExceptionHandler
will only catch Java exceptions.I’m getting the same exception and it can’t be caught by uncaught exception handler. In my Android app I’ve tried this code:
with handler, which only writes exception name to console and then returns control to default handler, but that code hadn’t been executed before the app crash.
I was trying to investigate, why Crashlytics doesn’t log this exceptions. Maybe that is the reason… I remember, that once or twice I’ve seen native crashes in my fabric console, so crashlytics is able to log native crashes, but somehow not in this case.
You are a life saver! ❤️ I’ve been looking for your answer for three days to paste that code and to change jsc-android version to exactly that you’ve mentioned. And it’s now working! Error happend when I’ve upgraded RN version from 0.59 to 0.60. The app was broken for only the android, ios was fine. The strangest thing was that app compiled successfully so everything looked great, but when it launched, it crashed immediately.
I hate to just quote you but I nearly missed your solution in the noise of this thread. Thank you so much @YoranRoels!! This saved the day!
@Kudo Yeah I do have the crash log. We have shifted to v8 from jsc because we were experiencing a lot of crashes. But the same is happening using v8. below is the log
#00 pc 0000000000c31dd8 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so #01 pc 0000000000c3437c /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so #02 pc 0000000000c30554 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so #03 pc 0000000000c33070 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so #04 pc 0000000000bf2e94 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so (v8::internal::ItemParallelJob::Task::RunInternal()+24) #05 pc 0000000000a4d660 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so (v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run()+56) #06 pc 0000000000a4a074 /data/app/my.app.id-a42vFQTz2lrEJMUnXdYsYA==/lib/arm64/libv8.so #07 pc 0000000000067ec4 /system/lib64/libc.so (__pthread_start(void*)+36) #08 pc 000000000001f2f4 /system/lib64/libc.so (__start_thread+68)
@EmilScherdin ahhh no, I am not. Will give it a shot and report back thanks.
+1 Works for me. I had same problems. Thank you!
A little help to the ones still trying to address the startup crash:
adb logcat
in a consoleIt doesn’t solve the problem but let you find out something more. I’ve 2 apps, one is working well with the 64 bit, still struggling on the other one even if they’ve the same configuration. My crashing device is a One Plus 5t (64 bit)
I actually went through the trouble of bumping React-Native to 0.60.5 and enabling Hermes + 64-bit (which was a pain, as upgrading react-native always is) and I’m still having these issues on several Android phones (including HUAWEI MYA-L41).
I’ve tried just about everything I’ve found in other threads without much luck, so I can tell you bumping react-native and using Hermes doesn’t fix all of these issues.
The updated react-native + Hermes and 64-bit is amazing on other Android devices I’ve ran it on and our app has never felt smoother.
However, whenever I test on the specific device I mentioned (Huawei) it crashes instantly or after the app is open for 1-2 seconds without a specific crash message, I don’t have any other devices besides that one and a newer Huawei (which works perfectly) so I can’t give you more info on other phones.
If anyone has made any progress with this issue or has any ideas for more specifically logging my issues, advice is always welcome and I’m willing to share any information regarding this issue. Thanks to the people in this thread for offering solutions, but no luck so far. 🙂
@afras21 you mean google has lifted the 64bit restriction from playstore?
Hi guys My app also crash in some android device when compile in 64bits
Are you using the react-native-elements package version 1.1.0?? Because the component Header crash my app and also the Avatar component when I put the prop icon or title
Can someone else check if the same thing happens to them?
Still crashing on Caterpillar S41 (Android 8.0). The fix resolved issue on all other devices. Also created a new issue. Tell me if this is not the right way to do.
You do not need to upgrade to 0.60 to consume the fix. You should be able to follow the instructions at https://github.com/react-native-community/jsc-android-buildscripts/#for-react-native-version-059. The version you want to install is
245459.0.0
or greater.@jacquesdev follow the steps in this guide: https://gist.github.com/Kudo/cc40662163fbd69dd01d66fd99476c17#file-steps_for_webkitgtk_2_24_2-md
@Kudo thanks for your fix, it seems to prevent the hell to occur.
My 2 cents there: I don’t have a
jni
folder but alib
one instead so using this command to check the version after unzipping:Thanks @Kudo , I have the same question @jacquesdev is asking 0.59.10 or
jsc-android-buildscripts
?@Kudo No problems either with your last version. Great work! 💪
@wmonecke you have to add both (react-native and kudo ci) maven repository to get it compiled maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url “$rootDir/…/node_modules/react-native/android” }
maven{ // Local Maven repo containing AARs with JSC library built for Android url “$rootDir/…/node_modules/@kudo-ci/jsc-android/dist” }
@wmonecke The issue seems weird to me. I didn’t touch any java code or gradle dependencies in the JSC AAR. Could you please check the issue, or briefly describe how you apply the patch? I guess you accidentally use old RN dependency and you could verify by
./gradlew :app:dependencies | grep 'com.facebook.react:react-native:'
(please make sure the returned RN version is that you expected).Thank you so much! Just had to update realm to 2.28. @Kudo special thanks. My app already works correctly !
This seems related to
realm
please check https://github.com/realm/realm-js/issues/2261#issuecomment-468691502 https://github.com/realm/realm-js/issues/2221I haven’t had the chance to integrate this new build yet as I have some other project milestones getting in the way but plan to do so as soon as these are out of the way.
@Kudo 's original
no-dfg
builds fixed 99% of the crashes that I had seen and whilst I was able to stimulate a single crash, I was not able to repeat it.I believe that @tuncaulubilge was able to reproduce crashes with the original
no-dfg
builds, so it would be interesting to see what he makes of this new build.@Kudo I can confirm
@kudo-ci/jsc-android@245459-fix-clear-cache-no-dfg
works for me as well. No crash occur in Samsung Galaxy S7 SM-G930FD that was happening earlier with RN v0.59 and has been fixed withno-jit
orjsc-android v241213.2.0
.@RomanovYurii When we removed 64 bit ndk filters “arm64-v8a”, “x86_64” from ndk abiFilters in defaultConfig block of build.gradle by provide only 32 bit support. The crash has gone but as per Google 64 bit support mandate this needs to be fixed with 64 bit ndk support .
This code saves lifes
@Kudo I’ve now had feedback on test builds using both
@kudo-ci/jsc-android@241213-fix-clear-cache-dfg
and@kudo-ci/jsc-android@241213-fix-clear-cache-no-dfg
. Both test builds appear to be crash-free so far on the Samsung Galaxy S7 Edge / Android 7.0 (up to now the problem combination)The crash is still happening here too after reverting to 32 bit
I’m getting crashes on OnePlus 3 as well, but removing 64bit support doesn’t help. I’m getting crashes with a clean react-native init project (also on emulators when opening app’s APK).