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 with V1.2.0 #98

Closed
skdev24 opened this issue Jul 10, 2021 · 14 comments · Fixed by #108
Closed

Android crash with V1.2.0 #98

skdev24 opened this issue Jul 10, 2021 · 14 comments · Fixed by #108

Comments

@skdev24
Copy link

skdev24 commented Jul 10, 2021

Describe the bug

Crashing in Android with v1.2.0

It was working perfectly with version 1.1.6, then after updating with latest version app started to crash, if I revert back to 1.1.6 it works.

Android logs

07-10 10:43:36.955 23729 23851 D SoLoader: Loaded: libreact_nativemodule_core.so
07-10 10:43:36.957 23729 23851 D SoLoader: Loaded: libturbomodulejsijni.so
07-10 10:43:36.967 23729 23851 I MMKV    : <MMKV.cpp:156::initialize> version v1.2.10, page size 4096, arch armeabi-v7a/NEON
07-10 10:43:36.967 23729 23851 I MMKV    : <MMKV.cpp:198::initializeMMKV> root dir: /data/user/0/com.appname/files/mmkv
07-10 10:43:36.967 23729 23851 I HermesVM: HermesRuntimeImpl::call: Unable to call function: stack overflow
07-10 10:43:36.968 23729 23851 F libc    : /buildbot/src/googleplex-android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type facebook::jsi::JSINativeException: HermesRuntimeImpl::call: Unable to call function: stack overflow" failed
07-10 10:43:37.422 23867 23867 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 10303 <<<<<<
07-10 10:43:37.436 23867 23867 W /system/bin/app_process32: Could not reserve sentinel fault page

Platform Information:

"react": "17.0.2",
"react-native": "0.64.2",
"react-native-reanimated": "^2.2.0",
"react-native-mmkv": "^1.2.0",

@mydesweb
Copy link

I confirm, v1.2.0 is crashing on android .. 1.1.6 is working

I/MMKV: <MMKV.cpp:156::initialize> version v1.2.10, page size 4096, arch x86
    <MMKV.cpp:198::initializeMMKV> root dir: /data/user/0/appbundle/files/mmkv
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2 in tid 14421 (create_react_co), pid 14319

@vuongpsht
Copy link

vuongpsht commented Jul 16, 2021

+1 with 1.2.0
work well on 1.1.6 (need to upgrade ios version on Xcode and ios version on Podfile)

@mrousavy
Copy link
Owner

Can you guys confirm that react-native-mmkv v1.2.1 fixes the issue for you?

@skdev24
Copy link
Author

skdev24 commented Jul 29, 2021

Hey @mrousavy

I tried building v1.2.1, had cleared all cache and did fresh install, still facing the crash at the app start in Android.

07-29 12:08:22.470 21778 24959 I MMKV    : <MMKV.cpp:156::initialize> version v1.2.10, page size 4096, arch arm64-v8a
07-29 12:08:22.470 21778 24959 I MMKV    : <MMKV.cpp:167::initialize> armv8 AES instructions is supported
07-29 12:08:22.470 21778 24959 I MMKV    : <MMKV.cpp:175::initialize> armv8 CRC32 instructions is supported
07-29 12:08:22.471 21778 24959 I MMKV    : <MMKV.cpp:198::initializeMMKV> root dir: /data/user/0/com.appname/files/mmkv
.
.
07-29 12:08:24.129 25034 25034 F DEBUG   :     NOTE: Function names and BuildId information is missing for some frames due
07-29 12:08:24.129 25034 25034 F DEBUG   :     NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
07-29 12:08:24.129 25034 25034 F DEBUG   :     NOTE: found under the lib/ directory are readable.
07-29 12:08:24.129 25034 25034 F DEBUG   :       #00 pc 000000000002f5d4  /data/data/com.appname/lib-main/libhermes.so
07-29 12:08:24.130 25034 25034 F DEBUG   :       #01 pc 0000000000049884  /data/app/com.appname-Qc7MX5S3yBBy1UVz_znAPg==/base.apk!libmmkvnative.so (offset 0x2912000) (facebook::jsi::Function::createFromHostFunction(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, unsigned int, std::__ndk1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)+132) (BuildId: c2faa11a449d9e4bc368ec82d0665b0491dd3e9e)
07-29 12:08:24.130 25034 25034 F DEBUG   :       #02 pc 0000000000048fd4  /data/app/com.appname-Qc7MX5S3yBBy1UVz_znAPg==/base.apk!libmmkvnative.so (offset 0x2912000) (install(facebook::jsi::Runtime&)+112) (BuildId: c2faa11a449d9e4bc368ec82d0665b0491dd3e9e)
07-29 12:08:24.130 25034 25034 F DEBUG   :       #03 pc 000000000004a4fc  /data/app/com.appname-Qc7MX5S3yBBy1UVz_znAPg==/base.apk!libmmkvnative.so (offset 0x2912000) (Java_com_reactnativemmkv_MmkvModule_nativeInstall+108) (BuildId: c2faa11a449d9e4bc368ec82d0665b0491dd3e9e)

@mrousavy mrousavy reopened this Aug 3, 2021
@mrousavy
Copy link
Owner

mrousavy commented Aug 3, 2021

That's so weird. I reverted the MMKV bump commits, so it has to be one of those changes:

Reverting one of those must fix the issue 🤨

@fahad86
Copy link
Contributor

fahad86 commented Aug 4, 2021

Also crashes in debug builds. Works fine with 1.1.6
Screenshot 2021-08-04 at 12 50 30 PM

@PhilipTocsen
Copy link

We have the same problem in out project. I wanted to look into that and tried out our example app. To my surprise, it just worked. Then i copied over one of the resulting .aar files into our project and it worked, too. So it looks like there is a problem with the packaged android.aar. So maybe the problem is in the release management?

On another note: there are two android.aar files generated, android-debug.arr and android-release.arr. Looking at the filesize, is seems the debug version is in the npm package. It would be great if an release build would use the release .aar

@johncblandii
Copy link

Confirmed 1.2.0 and 1.2.1 are both a problem for dev and release versions. Locking to 1.1.6 is the only solution I've found.

@mrousavy
Copy link
Owner

mrousavy commented Aug 6, 2021

Tried cleaning and rebuilding everything, does v1.2.2 work for you guys?

@fahad86
Copy link
Contributor

fahad86 commented Aug 6, 2021

Tried cleaning and rebuilding everything, does v1.2.2 work for you guys?

node_modules/react-native-mmkv is missing the android folder hence the project fails to compile

@mrousavy
Copy link
Owner

mrousavy commented Aug 9, 2021

Okay so sorry guys I had to publish a few version before I finally got it right. Take a look at v1.2.5 and let me know if that builds for you now.

@thegitparticle
Copy link

@mrousavy it still crashes with 1.2.5. Also tried with 1.1.6 and it crashes on launch as well

@mrousavy
Copy link
Owner

mrousavy commented Sep 4, 2021

I just released 1.3.0 (yay 🎉), can you test if that works for you guys? It does work fine in the Example App (which is on RN 0.65.1)

@mrousavy
Copy link
Owner

mrousavy commented Sep 7, 2021

While I already spent way too much of my free time on this issue to fix the crash for random people on the internet, I spent some more time on this yesterday and finally fixed it. Check out 1.3.1. 🎉🎉🎉🎉

If you appreciate my efforts, please consider buying me a coffee for my next late-night debug session: ❤️ GitHub sponsors

@mrousavy mrousavy closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants