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

JNI DETECTED ERROR IN APPLICATION: java_object == null #826

Closed
dmitry-fbm opened this issue Nov 21, 2022 · 17 comments
Closed

JNI DETECTED ERROR IN APPLICATION: java_object == null #826

dmitry-fbm opened this issue Nov 21, 2022 · 17 comments
Labels
bug Something isn't working crash

Comments

@dmitry-fbm
Copy link

Cannot reproduce this locally but seeing such errors in Google Console, coming from production apps. FWIW, looks like only two device types are affected, never seen any other:

image

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.company.app <<<

backtrace:
  #00  pc 0x000000000004f75c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168)
  #01  pc 0x00000000006d2a4c  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+704)
  #02  pc 0x0000000000016ea8  /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+80)
  #03  pc 0x0000000000016450  /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+352)
  #04  pc 0x0000000000445224  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1612)
  #05  pc 0x000000000032ff84  /apex/com.android.art/lib64/libart.so (art::JNI<false>::GetObjectClass(_JNIEnv*, _jobject*)+996)
  #06  pc 0x000000000013f7d4  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/split_config.arm64_v8a.apk!libAgoraRtcWrapper.so (agora::iris::rtc::IrisRtcEngineImplAndroid::IrisRtcEngineImplAndroid(_JNIEnv*, _jobject*, _jobject*)+404)
  #07  pc 0x000000000013f5ec  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/split_config.arm64_v8a.apk!libAgoraRtcWrapper.so (Java_io_agora_iris_rtc_IrisRtcEngine_CreateIrisRtcEngine+68)
  #08  pc 0x0000000000440554  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148)
  #09  pc 0x000000000020a2b0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #10  pc 0x000000000028980a  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.agora.iris.rtc.IrisRtcEngine.<init>+6)
  #11  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #12  pc 0x0000000000287d1c  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.agora.agora_rtc_engine.AgoraRtcEnginePlugin.initPlugin+48)
  #13  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #14  pc 0x0000000000287e3c  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.agora.agora_rtc_engine.AgoraRtcEnginePlugin.onAttachedToEngine+68)
  #15  pc 0x000000000020b074  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #16  pc 0x00000000002f4bf0  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add+220)
  #17  pc 0x000000000020b074  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #18  pc 0x000000000030ccbe  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.plugins.GeneratedPluginRegistrant.registerWith+22)
  #19  pc 0x0000000000436e00  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+576)
  #20  pc 0x0000000000469534  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1960)
  #21  pc 0x0000000000468d64  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+48)
  #22  pc 0x0000000000440554  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148)
  #23  pc 0x0000000000436b6c  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+556)
  #24  pc 0x0000000000576218  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+988)
  #25  pc 0x0000000000211cc4  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+2036)
  #26  pc 0x0000000000442dd8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8)
  #27  pc 0x00000000002fbf70  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins)
  #28  pc 0x0000000000473fd4  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11196049161041742994)+396)
  #29  pc 0x0000000000473638  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1104)
  #30  pc 0x0000000000440688  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
  #31  pc 0x0000000000209398  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #32  pc 0x00000000002e90b6  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivity.configureFlutterEngine+18)
  #33  pc 0x000000000020b120  /apex/com.android.art/lib64/libart.so (nterp_helper+7712)
  #34  pc 0x00000000002e8178  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach+116)
  #35  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #36  pc 0x00000000002e9242  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivity.onCreate+26)
  #37  pc 0x000000000020a254  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #38  pc 0x00000000001f401e  /data/app/~~OExCJXT0N3vDyzfib-uEjQ==/com.company.app-JOnrRL3Iwlews6KgMkzVhg==/oat/arm64/base.vdex (com.company.app.MainActivity.onCreate+30)
  #39  pc 0x0000000002579c6c  /memfd:jit-zygote-cache```
@littleGnAl
Copy link
Contributor

Which version do you use?

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Nov 22, 2022
@dmitry-fbm
Copy link
Author

Sorry had to indicate in the description: agora_rtc_engine: ^5.3.0. Tried to upgrade to 6.x but it doesn't look ready for the prime time yet - in particular no web support.

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Nov 22, 2022
@littleGnAl
Copy link
Contributor

Thanks for reporting, I think this still need more time to investigate.

@littleGnAl littleGnAl added waiting for customer response waiting for customer response, or closed by no-reponse bot bug Something isn't working crash and removed waiting for customer response waiting for customer response, or closed by no-reponse bot labels Nov 25, 2022
@meandmymonkey7
Copy link

meandmymonkey7 commented Nov 28, 2022

We are also having this issue only for the same devices. One of our users wrote a review saying that this will crash the app at startup (even though we use the library at an internal page) so just adding a reference at pubspec.yaml is enough to make app crash. We also use the same version, 5.3.0

If this can help, Crash details apart from the stack trace that is already mentioned is the following :

[libAgoraRtcWrapper.so] agora::iris::rtc::IrisRtcEngineImplAndroid::IrisRtcEngineImplAndroid(_JNIEnv*, _jobject*, _jobject*)

@littleGnAl
Copy link
Contributor

Hello @dmitry-fbm @meandmymonkey7
Can you provide more info about the phone? Such as device model, system version, etc. Since there's not enough info to locate the error base on the crash stack.

@meandmymonkey7
Copy link

meandmymonkey7 commented Dec 1, 2022

@littleGnAl

This is the first one :

T-Mobile Augusta (REVVL 6 Pro)

TMAF035G

RAM
5.9 – 6.0 GB
Android version
Android 12 (SDK 31)
ABI
arm64-v8a, armeabi-v7a, armeabi
System on Chip
Mediatek MT6833
CPU
2x ARM Cortex-A76 (2200 MHz), 6x ARM Cortex-A55 (2000 MHz)
GPU
2x ARM Mali G57 (950 MHz)

Device type
Phone
Screen size
720x1640
Screen density (DPI)
280
OpenGL ES version
3.2
Vulkan version
1.1.0 (L1)
Product
Augusta

@meandmymonkey7
Copy link

@littleGnAl

This is the second one, basically they are both variants of the same device.

T-Mobile Bethpage (REVVL 6)

TMAF025G

RAM
3.8 – 3.9 GB
Android version
Android 12 (SDK 31)
ABI
arm64-v8a, armeabi-v7a, armeabi
System on Chip
Mediatek MT6833
CPU
2x ARM Cortex-A76 (2200 MHz), 6x ARM Cortex-A55 (2000 MHz)
GPU
2x ARM Mali G57 (950 MHz)
Device type
Phone
Screen size
720x1600
Screen density (DPI)
280
OpenGL ES version
3.2
Vulkan version
1.1.0 (L1)
Product
Bethpage

@littleGnAl
Copy link
Contributor

@meandmymonkey7 Thanks for your sharing.

@guohuake12
Copy link

guohuake12 commented Dec 10, 2022

We are also having this issue only for the same devices. One of our users wrote a review saying that this will crash the app at startup (even though we use the library at an internal page) so just adding a reference at pubspec.yaml is enough to make app crash. We also use the same version, 5.0.1

If this can help, Crash details apart from the stack trace that is already mentioned is the following :
JNI DETECTED ERROR IN APPLICATION: java_object == null


pid: 0, tid: 0 >>> com.xxxx.xxxxx <<<

backtrace:
#00 pc 0x000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168)
#1 pc 0x00000000006d2a4c /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+704)
#2 pc 0x0000000000016ea8 /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+80)
#3 pc 0x0000000000016450 /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+352)
#4 pc 0x0000000000445224 /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1612)
#5 pc 0x000000000032ff84 /apex/com.android.art/lib64/libart.so (art::JNI::GetObjectClass(_JNIEnv*, _jobject*)+996)
#6 pc 0x000000000013f7d4 /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxxx-NjQoVw7Cdm4thuk6kFUmoQ==/split_config.arm64_v8a.apk!libAgoraRtcWrapper.so (agora::iris::rtc::IrisRtcEngineImplAndroid::IrisRtcEngineImplAndroid(_JNIEnv*, _jobject*, _jobject*)+404)
#7 pc 0x000000000013f5ec /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/split_config.arm64_v8a.apk!libAgoraRtcWrapper.so (Java_io_agora_iris_rtc_IrisRtcEngine_CreateIrisRtcEngine+68)
#8 pc 0x0000000000440554 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148)
#9 pc 0x000000000020a2b0 /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
#10 pc 0x0000000000a2723a /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.agora.iris.rtc.IrisRtcEngine.+6)
#11 pc 0x000000000020a254 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#12 pc 0x0000000000a257ac /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.agora.agora_rtc_engine.AgoraRtcEnginePlugin.initPlugin+48)
#13 pc 0x000000000020a254 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#14 pc 0x0000000000a258fc /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.agora.agora_rtc_engine.AgoraRtcEnginePlugin.onAttachedToEngine+68)
#15 pc 0x000000000020b074 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#16 pc 0x0000000000a92ce4 /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add+220)
#17 pc 0x000000000020b074 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#18 pc 0x0000000000aab094 /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.plugins.GeneratedPluginRegistrant.registerWith+32)
#19 pc 0x0000000000436e00 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+576)
#20 pc 0x0000000000469534 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1960)
#21 pc 0x0000000000468d64 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+48)
#22 pc 0x0000000000440554 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148)
#23 pc 0x0000000000436b6c /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+556)
#24 pc 0x00000000005679dc /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+2480)
#25 pc 0x000000000022f96c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+1784)
#26 pc 0x0000000000442dd8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8)
#27 pc 0x0000000000a9a16c /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins)
#28 pc 0x0000000000473fd4 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.11196049161041742994)+396)
#29 pc 0x0000000000473638 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1104)
#30 pc 0x0000000000440688 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#31 pc 0x0000000000209398 /apex/com.android.art/lib64/libart.so (nterp_helper+152)
#32 pc 0x0000000000a872f2 /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivity.configureFlutterEngine+18)
#33 pc 0x000000000020b120 /apex/com.android.art/lib64/libart.so (nterp_helper+7712)
#34 pc 0x0000000000a863ac /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach+116)
#35 pc 0x000000000020a254 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#36 pc 0x0000000000a8747e /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (io.flutter.embedding.android.FlutterActivity.onCreate+26)
#37 pc 0x000000000020a254 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#38 pc 0x00000000009dcdac /data/app/~~bJs8nvd_qFs90jL45QDQbg==/com.xxxx.xxxx-NjQoVw7Cdm4thuk6kFUmoQ==/oat/arm64/base.vdex (com.xxxx.xxxx.MainActivity.onCreate+120)
#39 pc 0x000000000257876c /memfd:jit-zygote-cache

littleGnAl added a commit that referenced this issue Jan 5, 2023
littleGnAl added a commit that referenced this issue Jan 5, 2023
@littleGnAl
Copy link
Contributor

This should be fixed on master branch.

@littleGnAl
Copy link
Contributor

BTW, we recommend you upgrade to agora_rtc_engine: ^6.1.0 if possible.

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 5, 2023
@dmitry-fbm
Copy link
Author

This should be fixed on master branch.

@littleGnAl is this fixed only in 6.x or in 5.x too?

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 9, 2023
@littleGnAl
Copy link
Contributor

@dmitry-fbm This crash is only on 5.x, and won't happen on 6.x, since we do not initialize the RtcEngine on the java side directly after 6.x.

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 10, 2023
@dmitry-fbm
Copy link
Author

Thanks @littleGnAl. Looks a bit scary, is this safe to use the entire master?

image

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 10, 2023
@littleGnAl
Copy link
Contributor

@dmitry-fbm Don't worry, this is cause the main branch is an entirely new branch.
If you use 5.x, you should compare based on 5.3.1.
v5.3.1...master

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 11, 2023
@dmitry-fbm
Copy link
Author

Hello, I confirm that the issue is gone after branch switch. Thanks for fixing it.

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Jan 26, 2023
@github-actions
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
littleGnAl added a commit that referenced this issue May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working crash
Projects
None yet
Development

No branches or pull requests

4 participants