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

emoji 代码需要在底层里过滤处理 #350

Closed
oncity opened this issue May 26, 2016 · 9 comments
Closed

emoji 代码需要在底层里过滤处理 #350

oncity opened this issue May 26, 2016 · 9 comments
Assignees

Comments

@oncity
Copy link

oncity commented May 26, 2016

JSON 含有 emoji 代码,会引起 utf8 crash ,希望能处理这个严重问题

@chenzefeng09
Copy link
Contributor

same crash issue when i displaying emoji in a <text> tag.

crash log:
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xf0
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] string: '[{"module":"dom","method":"addElement","args":["root",{"ref":"5","type":"cell","attr":{"index":0,"append":"tree"},"style":{"flexDirection":"column","width":750},"event":["click"],"children":[{"ref":"6","type":"div","attr":{},"style":{"flexDirection":"row","width":750,"padding":24},"children":[{"ref":"7","type":"image","attr":{"src":"http://img.yimutian.com/avatar/609aea8b1924db3d6d27f90c446939b2.jpg"},"style":{"width":90,"height":90,"borderRadius":45,"borderColor":"#e2e2e2","borderWidth":1}},{"ref":"8","type":"div","attr":{},"style":{"flexDirection":"column","flex":1,"justifyContent":"center","marginLeft":24},"children":[{"ref":"9","type":"div","attr":{},"style":{"flexDirection":"row","alignItems":"center"},"children":[{"ref":"10","type":"text","attr":{"value":"陈泽峰"},"style":{"fontSize":32}}]},{"ref":"13","type":"text","attr":{"value":"😁","textoverflow":"ellipsis","lines":"1"},"style":{"marginTop":12,"color":"#999999","fontSize":28}}]},{"ref":"14","type":"t
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] in call to NewStringUTF
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] from int com.taobao.weex.bridge.WXBridge.execJS(java.lang.String, java.lang.String, java.lang.String, com.taobao.weex.bridge.WXJSObject[])
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] "JSBridgeThread" prio=5 tid=18 Runnable
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x12e4d970 self=0xf3fb0c00
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] | sysTid=13717 nice=0 cgrp=default sched=0/0 handle=0xf3c54c80
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] | state=R schedstat=( 4063939723 924434460 3028 ) utm=334 stm=71 core=2 HZ=100
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] | stack=0xe09a0000-0xe09a2000 stackSize=1036KB
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #00 pc 00005d03 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext
)+83)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #1 pc 00003051 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext_)+33)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #2 pc 003c9b97 /system/lib/libart.so (art::DumpNativeStack(std::_1::basic_ostream<char, std::1::char_traits >&, int, char const, art::mirror::ArtMethod)+135)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #3 pc 00392f52 /system/lib/libart.so (art::Thread::Dump(std::1::basic_ostream<char, std::1::char_traits >&) const+306)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #4 pc 001029bb /system/lib/libart.so (art::JniAbort(char const
, char const
)+1019)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #5 pc 0010359c /system/lib/libart.so (art::JniAbortF(char const
, char const
, ...)+108)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #6 pc 0010827e /system/lib/libart.so (art::ScopedCheck::Check(bool, char const
, ...) (.constprop.131)+3102)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #7 pc 0010e21d /system/lib/libart.so (art::CheckJNI::NewStringUTF(JNIEnv, char const*)+93)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #8 pc 001a35c6 /system/lib/libhoudini.so (???)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #9 pc 00196244 /system/lib/libhoudini.so (???)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] native: #10 pc 001ba094 /system/lib/libhoudini.so (???)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] at com.taobao.weex.bridge.WXBridge.execJS(Native method)
05-26 22:38:30.330 13676-13717/com.ymt360.app.mass A/art: art/runtime/check_jni.cc:65] at com.taobao.weex.bridge.WXBridgeManager.invokeCallJSBatch(WXBridgeManager.java:865)

@YorkShen
Copy link
Contributor

YorkShen commented May 27, 2016

Please attach the source file of .we witch crash info @oncity @chenzefeng09

@YorkShen
Copy link
Contributor

@zshshr JNI crash when execJS, anything we can do?

@oncity
Copy link
Author

oncity commented May 30, 2016

@YorkShen 能不能在 http get 数据后,过滤或替换一下数据?javascript 层,处理不到这个 crash

@YorkShen
Copy link
Contributor

@oncity Pls attach the corresponding .we source file @oncity . I will see what I can do, thanks

@YorkShen
Copy link
Contributor

YorkShen commented Jun 3, 2016

@chenzefeng09 Works for me. And I am using this file. There is an improvement in text render mechanism on weex android, checkout android-feature-20160706 branch an give it another try. If it doesn't work for you, upload the .we source file, pls. Thank you.

xkli added a commit that referenced this issue Jun 7, 2016
…/weex into android-feature-20160607

* 'android-feature-20160607' of https://github.com/alibaba/weex:
  * [Android] Fix #350, re-commit text refactor and improve the performance.
  * [android] disable input scroll
@LiushuiXiaoxia
Copy link

怎么解决的?确实,如果好友表情,就会出现这个错误。

@YorkShen
Copy link
Contributor

@LiushuiXiaoxia 这是Android 6.0以下,系统NDK的一个bug。在6.0以下,NDK只能处理Modified UTF-8,如果处理了非BMP字符,就会导致crash。emoji属于SMP字符,所以会触发上述问题。
参考 #313

@Jinjiang
Copy link
Contributor

这个问题由于长期没有讨论,所以做关闭处理
如果有后续讨论可以在这里继续
谢谢支持

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

No branches or pull requests

5 participants