Comments (10)
I think the root cause is in facebook::jsi::valueFromDynamic
:
case folly::dynamic::OBJECT: {
Object ret(runtime);
for (const auto& element : dyn.items()) {
Value value = valueFromDynamic(runtime, element.second);
if (element.first.isNumber() || element.first.isString()) {
ret.setProperty(runtime, element.first.asString().c_str(), value); // HERE
}
}
return std::move(ret);
}
This code will call into setProperty
with a const char *
, which it assumes is ASCII.
What is most likely happening is that you have a non-ASCII character going over the bridge (MessageQueue
).
@HeribertoAlves, if you are willing to make a small change to the C++ files and re-compile your app,
can you try changing the line I show in valueFromDynamic
(in JSIDynamic.cpp) to be this instead?
ret.setProperty(runtime, PropNameID::forUtf8(runtime, element.first.asString()), value);
If that fixes the issue, you or I can open up a PR for that fix to JSI.
from hermes.
It worked.
I think it is best(and fair) if you open a PR because you developed the solution! :)
from hermes.
Ok landed a commit to fix this in RN: facebook/react-native@c24387e.
Closing this as resolved.
from hermes.
Stil seeing this in 0.60.5
from hermes.
@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?
from hermes.
@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 valueFromDynamic
so it shouldn't be coming from there anymore.
from hermes.
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.
from hermes.
@dulinriley looks the same to me:
2019-08-23 18:49:04.669 4302-4302/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-08-23 18:49:04.669 4302-4302/? A/DEBUG: Build fingerprint: 'Android/vbox86p/vbox86p:7.0/NRD90M/391:userdebug/test-keys'
2019-08-23 18:49:04.669 4302-4302/? A/DEBUG: Revision: '0'
2019-08-23 18:49:04.669 4302-4302/? A/DEBUG: ABI: 'x86'
2019-08-23 18:49:04.669 4302-4302/? A/DEBUG: pid: 4039, tid: 4197, name: mqt_js >>> com.genolingo.genolingo <<<
2019-08-23 18:49:04.670 4302-4302/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2019-08-23 18:49:04.672 4302-4302/? A/DEBUG: Abort message: '/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<unsigned char>(str[i]) < 128 && "non-ASCII character in string"" failed'
2019-08-23 18:49:04.673 4302-4302/? A/DEBUG: eax 00000000 ebx 00000fc7 ecx 00001065 edx 00000006
2019-08-23 18:49:04.673 4302-4302/? A/DEBUG: esi c2af9978 edi c2af9920
2019-08-23 18:49:04.673 4302-4302/? A/DEBUG: xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b
2019-08-23 18:49:04.673 4302-4302/? A/DEBUG: eip eea55bb9 ebp c2af84a8 esp c2af844c flags 00000292
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: backtrace:
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #00 pc 00000bb9 [vdso:eea55000] (__kernel_vsyscall+9)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #01 pc 0007a2ec /system/lib/libc.so (tgkill+28)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #02 pc 00075b35 /system/lib/libc.so (pthread_kill+85)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #03 pc 0002784a /system/lib/libc.so (raise+42)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #04 pc 0001ee26 /system/lib/libc.so (abort+86)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #05 pc 00023d38 /system/lib/libc.so (__libc_fatal+40)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #06 pc 0001f2f0 /system/lib/libc.so (__assert2+64)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #07 pc 000174eb /data/app/com.genolingo.genolingo-1/lib/x86/libhermes.so (_ZN8facebook6hermes17HermesRuntimeImpl21createStringFromAsciiEPKcj+427)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #08 pc 0001a54a /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #09 pc 0003500d /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi6Object11setPropertyIRNS0_5ValueEEEvRNS0_7RuntimeEPKcOT_+77)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #10 pc 00034d54 /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi16valueFromDynamicERNS0_7RuntimeERKN5folly7dynamicE+580)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #11 pc 00034cff /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi16valueFromDynamicERNS0_7RuntimeERKN5folly7dynamicE+495)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #12 pc 00034cff /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi16valueFromDynamicERNS0_7RuntimeERKN5folly7dynamicE+495)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #13 pc 00034cff /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi16valueFromDynamicERNS0_7RuntimeERKN5folly7dynamicE+495)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #14 pc 00034c66 /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook3jsi16valueFromDynamicERNS0_7RuntimeERKN5folly7dynamicE+342)
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #15 pc 00027c72 /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so
2019-08-23 18:49:04.679 4302-4302/? A/DEBUG: #16 pc 0001f237 /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook5react11JSIExecutor21defaultTimeoutInvokerERKNSt6__ndk18functionIFvvEEENS3_IFNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvEEE+39)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #17 pc 000227b7 /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZNSt6__ndk128__invoke_void_return_wrapperIvE6__callIJRPFvRKNS_8functionIFvvEEENS3_IFNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEvEEEES7_SF_EEEvDpOT_+119)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #18 pc 000226da /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZNSt6__ndk110__function6__funcIPFvRKNS_8functionIFvvEEENS2_IFNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEvEEEENSA_ISG_EESF_EclES6_OSE_+42)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #19 pc 0002533a /data/app/com.genolingo.genolingo-1/lib/x86/libhermes-executor-debug.so (_ZN8facebook5react11JSIExecutor12callFunctionERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKN5folly7dynamicE+1482)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #20 pc 000a4bbe /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #21 pc 000a63fe /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #22 pc 00061727 /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #23 pc 0004ed72 /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE8dispatchENS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIS4_NS3_8RunnableEE8JavaPartESB_vE11_javaobjectEEE+50)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #24 pc 0004ecd9 /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail15FunctionWrapperIPFvNS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassINS_5react15JNativeRunnableENS6_8RunnableEE8JavaPartES8_vE11_javaobjectEEEEXadL_ZNS1_13MethodWrapperIMS7_FvvEXadL_ZNS7_3runEvEES7_vJEE8dispatchESE_EESD_vJEE4callEP7_JNIEnvP8_jobject+73)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #25 pc 0004ec83 /data/app/com.genolingo.genolingo-1/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE4callEP7_JNIEnvP8_jobject+35)
2019-08-23 18:49:04.680 4302-4302/? A/DEBUG: #26 pc 01407d8c /data/app/com.genolingo.genolingo-1/oat/x86/base.odex (offset 0x13ab000)
from hermes.
@HeribertoAlves looks like my commit is tagged with the 0.61 release candidate of React Native.
I'm not sure if that's available for download (as a binary package) or not, so you'll probably need to build from master.
from hermes.
@HeribertoAlves looks like my commit is tagged with the 0.61 release candidate of React Native.
I'm not sure if that's available for download (as a binary package) or not, so you'll probably need to build from master.
Thanks for your reply @dulinriley ! Not a problem for me. I created a script that handles this
issue. I'll just have to wait for 0.61 version.
from hermes.
Related Issues (20)
- simplifySwitchInst in SimplifyCFG ignores negative zero HOT 1
- iOS App submission will require a privacy manifest and signature HOT 6
- Possible memory leak HOT 30
- Compile failure with optimized ASan builds HOT 4
- Thread 6: "Exception NSException * "Unhandled JS Exception: Error: invalid host, js engine: hermes" HOT 32
- Parser: improve error message when await is used in non-async functions or instead of async
- JSRangeErrorException setting maximumFractionDigits to 0 with Intl.NumberFormat currency style HOT 1
- Unreachable in ES6 is reachable. HOT 1
- Update documentation on using custom Hermes builds HOT 3
- Building Static Hermes on Windows HOT 4
- Problems finding libraries with fresh compile under windows HOT 3
- Conversion of large array to a Set seems slow HOT 3
- React Native & Hermes: Is Additional Code Obfuscation Beneficial? HOT 1
- Array.protoype.indexOf() Performance Regression HOT 3
- 'hermes-engine' uses the unencrypted 'http' protocol to transfer the Pod.
- hermes-eslint missing `__defineGeneric` in context `getScope` HOT 1
- Date constructor accept wrong ISO 8601 date HOT 2
- libc.so (SIGABRT, SIGSEGV) HOT 4
- Performance regression traversing large arrays compared to other engines HOT 4
- Hermes 0.7.2 : Max heap size was exceeded HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.