Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[Android] Fix Android JNI Crash #2827

Merged
merged 9 commits into from
Aug 15, 2019

Conversation

YorkShen
Copy link
Contributor

@YorkShen YorkShen commented Aug 14, 2019

Brief Description of the PR

NPE in WXBridge::ReportException

jni_object() in ReportException() could be nullptr if InitFramework() is not invoked.

JNI DETECTED ERROR IN APPLICATION: obj == null
 in call to CallVoidMethodV
from int com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(java.lang.String, java.lang.String, java.lang.String, com.taobao.weex.bridge.WXJSObject[])
......

(_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+22)
(WeexCore::WXBridge::ReportException(_JNIEnv*, char const*, char const*, char const*)+132)
 (WeexCore::AndroidSide::ReportException(char const*, char const*, char const*)+34)
......

(WeexCore::CoreSideInPlatform::CreateInstance(char const*, char const*, char const*, int, char const*, char const*, char const*, std::__ndk1::vector<InitFrameworkParams*, std::__ndk1::allocator<InitFrameworkParams*>>&, char const*)+820)
at com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(Native method)
at com.taobao.weex.bridge.WXBridge.createInstanceContext(Taobao:233)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstanceContext(Taobao:1981)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstance(Taobao:1709)

Checklist

  • Demo:
  • Documentation:

`jni_object()` in `ReportException()` could be nullptr if `InitFramework()` is not invoked.

```
JNI DETECTED ERROR IN APPLICATION: obj == null
 in call to CallVoidMethodV
from int com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(java.lang.String, java.lang.String, java.lang.String, com.taobao.weex.bridge.WXJSObject[])
......

(_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+22)
(WeexCore::WXBridge::ReportException(_JNIEnv*, char const*, char const*, char const*)+132)
 (WeexCore::AndroidSide::ReportException(char const*, char const*, char const*)+34)
......

(WeexCore::CoreSideInPlatform::CreateInstance(char const*, char const*, char const*, int, char const*, char const*, char const*, std::__ndk1::vector<InitFrameworkParams*, std::__ndk1::allocator<InitFrameworkParams*>>&, char const*)+820)
at com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(Native method)
at com.taobao.weex.bridge.WXBridge.createInstanceContext(Taobao:233)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstanceContext(Taobao:1981)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstance(Taobao:1709)
```
message_loop() in PostTaskToMsgLoop() could be nullptr if InitFramework() is not invoked.
@weex-bot
Copy link

weex-bot commented Aug 14, 2019

Warnings
⚠️ No Changelog changes! - Can you add a Changelog? To do so,append your changes to the changelog.md
⚠️ If your PR is about fixing a bug excluding crash the code,you should add the demo link in the PR description. Demo link: http://dotwe.org/vue
⚠️ If you update the code, maybe you should update the documentation and add the documentation link in the PR description. here is the guide about how to contribute documentation: https://github.com/apache/incubator-weex/blob/master/CONTRIBUTING.md#contribute-code-or-document
Messages
📖 danger test finished.

Generated by 🚫 dangerJS against 52ff668

@YorkShen YorkShen added this to the Weex 0.27 milestone Aug 14, 2019
jianhan-he
jianhan-he previously approved these changes Aug 14, 2019
Copy link
Contributor

@jianhan-he jianhan-he left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lucky-chen lucky-chen left a comment

Choose a reason for hiding this comment

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

LGTM

@lucky-chen lucky-chen merged commit 7e54ac5 into apache:master Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants