-
Notifications
You must be signed in to change notification settings - Fork 632
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
non-ASCII character in string - Crash in RN debug mode #47
Comments
I think the root cause is in
This code will call into @HeribertoAlves, if you are willing to make a small change to the C++ files and re-compile your app,
If that fixes the issue, you or I can open up a PR for that fix to JSI. |
It worked. |
…dynamic Summary: Based on Hermes Issue: #47 It was not actually a bug in Hermes, but a bug in JSI, assuming that all string property names from `folly::dynamic` are ASCII. Now we'll be more intentional and directly state `forUtf8` rather than the implicit ASCII encoding. Reviewed By: mhorowitz Differential Revision: D16347857 fbshipit-source-id: 6bcfbf9f918dc0a7a485b88a1b537d6c2dd322cc
…dynamic Summary: Based on Hermes Issue: facebook/hermes#47 It was not actually a bug in Hermes, but a bug in JSI, assuming that all string property names from `folly::dynamic` are ASCII. Now we'll be more intentional and directly state `forUtf8` rather than the implicit ASCII encoding. Reviewed By: mhorowitz Differential Revision: D16347857 fbshipit-source-id: 6bcfbf9f918dc0a7a485b88a1b537d6c2dd322cc
Ok landed a commit to fix this in RN: facebook/react-native@c24387e. |
Stil seeing this in 0.60.5 |
@dulinriley I applied your above patch and then did a gradle clean and then ran the build again and i'm still facing this error. Have I missed a step? |
@mtford90 this error could be coming from any place where you pass a non-ASCII (UTF-8 or UTFf-16) string into a Hermes/JSI API that expects ASCII characters. Is the stack trace for the crash at the same spot? I landed the fix to |
Hi @dulinriley! The error happens this the same place. I have to manually re-apply what you have done. I can confirm that it was not deployed on 0.60.5. |
@dulinriley looks the same to me:
|
@HeribertoAlves looks like my commit is tagged with the 0.61 release candidate of React Native. |
Thanks for your reply @dulinriley ! Not a problem for me. I created a script that handles this |
Summary: Depends on facebookincubator/fbjni#43. Removes all Bintray-specifics and replaces it with a Maven Central setup. Docs for this are coming next. Pull Request resolved: facebookincubator/fbjni#47 Test Plan: ``` ./gradlew uploadArchives ./gradlew -b host.gradle uploadArchives ``` Worked! Won't publish this, obviously. ![Screenshot 2021-02-19 at 16 15 22](https://user-images.githubusercontent.com/9906/108531010-1d93ff80-72ce-11eb-800f-b61035184ef0.png) Reviewed By: priteshrnandgaonkar Differential Revision: D26546096 Pulled By: passy fbshipit-source-id: cb74a5cb3caed1cbf9d7bd07125fd2fcb28e3d85
I open this new issue as @dulinriley requested.
It crash with the error below:
A/libc: /Users/willholen/intern/hermes/API/hermes/hermes.cpp:1378: auto facebook::hermes::HermesRuntimeImpl::createStringFromAscii(const char *, size_t)::(anonymous class)::operator()() const: assertion "static_cast(str[i]) < 128 && "non-ASCII character in string"" failed
Fatal signal 6 (SIGABRT), code -6 in tid 22378 (mqt_js)
stack trace:
tgkill 0x0000007fb2680838
abort 0x0000007fb2632ed4
__libc_fatal 0x0000007fb263aee0
__assert2 0x0000007fb2633624
facebook::hermes::HermesRuntimeImpl::createStringFromAscii(char const*, unsigned long) 0x0000007f8e129914
void facebook::jsi::Object::setPropertyfacebook::jsi::Value&(facebook::jsi::Runtime&, char const*, facebook::jsi::Value&&&) 0x0000007f9030b458
facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) 0x0000007f9030b198
facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) 0x0000007f9030b154
facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) 0x0000007f9030b154
facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) 0x0000007f9030b0cc
facebook::react::JSIExecutor::invokeCallback(double, folly::dynamic const&) 0x0000007f902fe01c
___lldb_unnamed_symbol185$$libreactnativejni.so 0x0000007f90ba7dc4
___lldb_unnamed_symbol228$$libreactnativejni.so 0x0000007f90ba8de4
___lldb_unnamed_symbol42$$libreactnativejni.so 0x0000007f90b6b8c0
facebook::jni::detail::MethodWrapper<void (facebook::react::JNativeRunnable::)(), &(facebook::react::JNativeRunnable::run()), facebook::react::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject>) 0x0000007f90b5ac78
facebook::jni::detail::FunctionWrapper<void ()(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject>), &(facebook::jni::detail::MethodWrapper<void (facebook::react::JNativeRunnable::)(), &(facebook::react::JNativeRunnable::run()), facebook::react::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject>)), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*) 0x0000007f90b5abf4
art_quick_generic_jni_trampoline 0x0000007fae2bc504
0x00000000996d5bd8
art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*) 0x0000007fade82da4
art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*) 0x0000007fae02d488
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007fae027b50
bool art::interpreter::DoInvoke<(art::InvokeType)0, false, false>(art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007fae054a64
art::JValue art::interpreter::ExecuteSwitchImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool) 0x0000007fae04c040
art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool) 0x0000007fae008930
art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*) 0x0000007fae00efcc
bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007fae027b30
bool art::interpreter::DoInvoke<(art::InvokeType)3, false, false>(art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x0000007fae05280c
art::JValue art::interpreter::ExecuteSwitchImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool) 0x0000007fae04fbec
art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool) 0x0000007fae008930
artQuickToInterpreterBridge 0x0000007fae28e958
art_quick_to_interpreter_bridge 0x0000007fae2bc620
0x00000000996983e0
The text was updated successfully, but these errors were encountered: