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

Add async exec call #28

Closed
wants to merge 8 commits into from
Closed

Add async exec call #28

wants to merge 8 commits into from

Conversation

ospfranco
Copy link
Owner

@ospfranco ospfranco commented Mar 6, 2022

Managed to implement spawning a C++ thread and returning the result of the SQL execution

@EduFrazao would you mind giving it a test? Try to run your queries with the asyncExecuteSql method

TODOS:

  • Clean up example project
  • Test on android
  • Check that the types are working correctly on a new project
  • Add an exception for eslint (currently throws no-undef for the global sqlite object)

@ospfranco ospfranco added enhancement New feature or request help wanted Extra attention is needed labels Mar 6, 2022
@ospfranco ospfranco self-assigned this Mar 6, 2022
@EduFrazao
Copy link
Collaborator

@ospfranco, do you belive that I was working on it for the last few days and was almost giving up? So many crashes trying to use jsCallInvoker. I will try it RIGHT NOW. :).

@EduFrazao
Copy link
Collaborator

@ospfranco I've tryed on Android 11 (Emulator and real device), with and without Hermes.
On both application crashes when running asyncExecuteSQL.

This is the JavaScript call:

db.asyncExecuteSql('SELECT .sqlite_version() AS version', undefined)
            .then((res) => {
              if (!res.status) {
                console.log('Its fine', res.rows?._array);
              } else {
                console.log('SQL Execution error', res.message);
              }
            })
            .catch((e) => {
              console.warn('any promise unexpected error', e);
            });

Error Without Hermes:

03-06 11:14:00.532 28951 28951 I crash_dump32: performing dump of process 28830 (target tid = 28901)
03-06 11:14:00.535 28951 28951 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-06 11:14:00.536 28951 28951 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.201013.001/6903271:user/release-keys'
03-06 11:14:00.536 28951 28951 F DEBUG   : Revision: '0'
03-06 11:14:00.536 28951 28951 F DEBUG   : ABI: 'x86'
03-06 11:14:00.536 28951 28951 F DEBUG   : Timestamp: 2022-03-06 11:14:00-0300
03-06 11:14:00.536 28951 28951 F DEBUG   : pid: 28830, tid: 28901, name: mqt_js  >>> com.vitruvio <<<
03-06 11:14:00.536 28951 28951 F DEBUG   : uid: 10251
03-06 11:14:00.536 28951 28951 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
03-06 11:14:00.536 28951 28951 F DEBUG   :     eax 00000000  ebx 0000709e  ecx 000070e5  edx 00000006
03-06 11:14:00.536 28951 28951 F DEBUG   :     edi f1a1681e  esi be4b6fc0
03-06 11:14:00.536 28951 28951 F DEBUG   :     ebp f44c5b90  esp be4b6f68  eip f44c5b99
03-06 11:14:00.590 28951 28951 F DEBUG   : backtrace:
03-06 11:14:00.590 28951 28951 F DEBUG   :       #00 pc 00000b99  [vdso] (__kernel_vsyscall+9)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #01 pc 0005ad68  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #02 pc 00076511  /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #03 pc 000b783c  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libc++_shared.so (BuildId: d5dd9c1863f07a4c97f61114c5c3210fca319b78)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #04 pc 000b13e0  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libc++_shared.so (__gxx_personality_v0+400) (BuildId: d5dd9c1863f07a4c97f61114c5c3210fca319b78)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #05 pc 0022fac2  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #06 pc 0022ff15  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #07 pc 00096795  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #08 pc 00096033  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #09 pc 00095e9f  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #10 pc 00095d7f  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #11 pc 00093665  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #12 pc 00029e24  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #13 pc 0006a5a3  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #14 pc 001f9f5c  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #15 pc 001f4daa  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #16 pc 001e0486  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #17 pc 001f8202  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #18 pc 001bee87  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #19 pc 00321634  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #20 pc 0038e33a  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #21 pc 001e360f  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #22 pc 001f8202  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #23 pc 001bee87  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #24 pc 00321634  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #25 pc 0038e33a  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #26 pc 001c617f  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #27 pc 001f8252  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #28 pc 001beedc  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #29 pc 00321782  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #30 pc 000751f5  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjsc.so (JSObjectCallAsFunction+501) (BuildId: 5f5a5573d128edc31d7e9fc5f07082631e283962)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #31 pc 00026aa0  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+336) (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #32 pc 0001f1f3  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (facebook::jsi::Value facebook::jsi::Function::call<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value&&) const+227) (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #33 pc 0001f04b  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #34 pc 00016b67  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #35 pc 00016e42  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #36 pc 00016d6a  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #37 pc 0001a117  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libjscexecutor.so (facebook::react::JSIExecutor::callFunction(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, folly::dynamic const&)+1463) (BuildId: ef609d33853a39fea985cbb89250f595281216c1)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #38 pc 00088c44  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #39 pc 0008a25a  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #40 pc 00067303  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #41 pc 0004e202  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (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*>)+50) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #42 pc 0004e166  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (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::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*>))+70) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #43 pc 0004e10a  /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/lib/x86/libreactnativejni.so (facebook::jni::detail::MethodWrapper<void (facebook::react::JNativeRunnable::*)(), &(facebook::react::JNativeRunnable::run()), facebook::react::JNativeRunnable, void>::call(_JNIEnv*, _jobject*)+42) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #44 pc 00142132  /apex/com.android.art/lib/libart.so (art_quick_generic_jni_trampoline+82) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #45 pc 020345d2  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.handleCallback+66)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #46 pc 02037291  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.dispatchMessage+65)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #47 pc 02037bf2  /memfd:jit-cache (deleted) (offset 0x2000000) (com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage+50)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #48 pc 0200b920  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Looper.loop+1584)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #49 pc 0013baf2  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #50 pc 001d0392  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #51 pc 00386701  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #52 pc 0037aa3e  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #53 pc 007a4d2d  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+637) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #54 pc 00135921  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #55 pc 003794aa  [anon:dalvik-classes.dex extracted in memory from /data/app/~~bR7sa8hbOWm7q8aWTJidLA==/com.vitruvio-ARHMZ_KH0a2AUEQXc3jMtQ==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #56 pc 007a355e  /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #57 pc 001359a1  /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #58 pc 000eb7d0  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #59 pc 0036fb02  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #60 pc 00379b00  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #61 pc 0078b325  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #62 pc 0014220d  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #63 pc 0013b922  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #64 pc 001d0381  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #65 pc 0062f37c  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+620) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #66 pc 0062f595  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+85) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #67 pc 00697701  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1537) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #68 pc 000e6974  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:14:00.590 28951 28951 F DEBUG   :       #69 pc 00078567  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)

Error with Hermes:

03-06 11:18:51.346 29200 29200 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-06 11:18:51.346 29200 29200 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.201013.001/6903271:user/release-keys'
03-06 11:18:51.346 29200 29200 F DEBUG   : Revision: '0'
03-06 11:18:51.346 29200 29200 F DEBUG   : ABI: 'x86'
03-06 11:18:51.346 29200 29200 F DEBUG   : Timestamp: 2022-03-06 11:18:51-0300
03-06 11:18:51.346 29200 29200 F DEBUG   : pid: 29074, tid: 29133, name: mqt_js  >>> com.vitruvio <<<
03-06 11:18:51.346 29200 29200 F DEBUG   : uid: 10252
03-06 11:18:51.346 29200 29200 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
03-06 11:18:51.346 29200 29200 F DEBUG   :     eax 00000000  ebx 00007192  ecx 000071cd  edx 00000006
03-06 11:18:51.346 29200 29200 F DEBUG   :     edi f1a1681e  esi be531e90
03-06 11:18:51.346 29200 29200 F DEBUG   :     ebp f44c5b90  esp be531e38  eip f44c5b99
03-06 11:18:51.403 29200 29200 F DEBUG   : backtrace:
03-06 11:18:51.403 29200 29200 F DEBUG   :       #00 pc 00000b99  [vdso] (__kernel_vsyscall+9)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #01 pc 0005ad68  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #02 pc 00076511  /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #03 pc 000b783c  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libc++_shared.so (BuildId: d5dd9c1863f07a4c97f61114c5c3210fca319b78)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #04 pc 000b13e0  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libc++_shared.so (__gxx_personality_v0+400) (BuildId: d5dd9c1863f07a4c97f61114c5c3210fca319b78)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #05 pc 0022fac2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #06 pc 0022ff15  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #07 pc 00096795  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #08 pc 00096033  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #09 pc 00095e9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #10 pc 00095d7f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #11 pc 00093665  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libsequel.so (BuildId: a4ce5d9317dc9ccc7acde8c019138a8fcc18596f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #12 pc 00016ceb  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-common-debug.so (std::__ndk1::__function::__func<facebook::jsi::DecoratedHostFunction, std::__ndk1::allocator<facebook::jsi::DecoratedHostFunction>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned int&&)+91) (BuildId: cd08645b691f5cd3da9c800dac4b52bca82e1ca6)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #13 pc 0002316d  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #14 pc 0002eac2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #15 pc 0005134f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #16 pc 0005063b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #17 pc 0005e4a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #18 pc 0002ee9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #19 pc 0013be21  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #20 pc 0002eac2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #21 pc 0005134f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #22 pc 0005063b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #23 pc 0005e4a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #24 pc 0002ee9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #25 pc 0013be21  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #26 pc 0002eac2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #27 pc 0005134f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #28 pc 0005063b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #29 pc 0005e4a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #30 pc 0002ee9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #31 pc 0002ce6e  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #32 pc 0013bac3  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #33 pc 0002eac2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #34 pc 0005134f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #35 pc 0005063b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #36 pc 0005e4a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #37 pc 0002ee9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #38 pc 0002e2e2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #39 pc 0005138a  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #40 pc 0005063b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #41 pc 0005e4a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #42 pc 0002ee9f  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #43 pc 0002e2e2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #44 pc 0002daa6  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #45 pc 00017b84  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes.so (BuildId: 4585ff3018ed10766db675f55e08bb32ee2c55bd)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #46 pc 000158a5  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-common-debug.so (BuildId: cd08645b691f5cd3da9c800dac4b52bca82e1ca6)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #47 pc 00020a13  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (facebook::jsi::Value facebook::jsi::Function::call<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value&&) const+227) (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #48 pc 0002086b  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #49 pc 000170b7  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (facebook::react::JSIExecutor::defaultTimeoutInvoker(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>)+39) (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #50 pc 00018fc2  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (void std::__ndk1::__invoke_void_return_wrapper<void>::__call<void (*&)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>), std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()> >(void (*&)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>), std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>&&)+114) (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #51 pc 00018eea  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (std::__ndk1::__function::__func<void (*)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>), std::__ndk1::allocator<void (*)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>)>, void (std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>)>::operator()(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>&&)+42) (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #52 pc 0001bea7  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libhermes-executor-debug.so (facebook::react::JSIExecutor::callFunction(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, folly::dynamic const&)+1463) (BuildId: 9dafca73ec02382437ea5f1f4cc9d09fb0f86f59)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #53 pc 00088c44  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #54 pc 0008a25a  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #55 pc 00067303  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #56 pc 0004e202  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (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*>)+50) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #57 pc 0004e166  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (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::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*>))+70) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #58 pc 0004e10a  /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/lib/x86/libreactnativejni.so (facebook::jni::detail::MethodWrapper<void (facebook::react::JNativeRunnable::*)(), &(facebook::react::JNativeRunnable::run()), facebook::react::JNativeRunnable, void>::call(_JNIEnv*, _jobject*)+42) (BuildId: 31891a62a1da457f7021ee18e223a898b86bbd1e)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #59 pc 00142132  /apex/com.android.art/lib/libart.so (art_quick_generic_jni_trampoline+82) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #60 pc 02036472  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.handleCallback+66)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #61 pc 020392b1  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.dispatchMessage+65)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #62 pc 02039722  /memfd:jit-cache (deleted) (offset 0x2000000) (com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage+50)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #63 pc 0200b940  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Looper.loop+1584)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #64 pc 0013baf2  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #65 pc 001d0392  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #66 pc 00386701  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #67 pc 0037aa3e  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #68 pc 007a4d2d  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+637) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #69 pc 00135921  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #70 pc 00384fc2  [anon:dalvik-classes.dex extracted in memory from /data/app/~~eAA3TAFQvUn8e5Oq9X3VQA==/com.vitruvio-QO9FcKfwXBH0iSesU84WFA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #71 pc 007a355e  /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #72 pc 001359a1  /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #73 pc 000eb7d0  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #74 pc 0036fb02  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #75 pc 00379b00  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #76 pc 0078b325  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #77 pc 0014220d  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #78 pc 0013b922  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #79 pc 001d0381  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #80 pc 0062f37c  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+620) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #81 pc 0062f595  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+85) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #82 pc 00697701  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1537) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #83 pc 000e6974  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
03-06 11:18:51.403 29200 29200 F DEBUG   :       #84 pc 00078567  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)

@ospfranco
Copy link
Owner Author

ospfranco commented Mar 6, 2022

I've had to update the sample app to use RN 0.67, on the previous version 0.63 it was crashing, you might try that.

Also, isn't your call missing the first param (db name)?

@EduFrazao
Copy link
Collaborator

I've had to update the sample app to use RN 0.67, on the previous version 0.63 it was crashing, you might try that.

Also, isn't your call missing the first param (db name)?

I will update to 0.67 here, no problem.
Ah, about the first parameter, sorry:
I use the "IDBConnection" Wrapper object for conveniency
Here, this object wraps the first parameter

asyncExecuteSql: (
        query: string,
        params: any[] | undefined
      ): Promise<QueryResult> => {
        return sqlite.asyncExecuteSql(options.name, query, params);
      },

I will redoo all the tests with 0.67 version and let you know. Thank you very mutch for your feedback.

@EduFrazao
Copy link
Collaborator

@ospfranco Upgraded my project to RN 0.67.3, and now it works, but I need to do a tweak on my code to avoid new calls to be dispatched to quick sql before the async method promise was called.
I don't know if its really the problem, but in a simple test it seems to work now.

I have some good scenarios where I can test this new approach and I will write a sequel_asyncExecSQLBatch right now.
Thanks!

@EduFrazao
Copy link
Collaborator

I tried to implement the batch update method but somehow it fails when resolving the promise.
Looks like we are try to modify the runtime in a unsafe way.

My code.

 // Spawn c++ thread
  thread t1([&rt, dbName, bulkParams, resolver] {
    auto res = executeBulk(rt, dbName, bulkParams.get());
    resolver->asFunction(rt).call(rt, move(res));
  });
  t1.detach();

It fails with:

03-06 15:24:23.695  3181  3181 F DEBUG   :       #21 pc 000158a5  /data/app/~~a95bVdqs394MXG64inhuug==/com.vitruvio-W2TTmX4rtM_dbkOexWQsFQ==/lib/x86/libhermes-executor-common-debug.so (BuildId: cd08645b691f5cd3da9c800dac4b52bca82e1ca6)
03-06 15:24:23.695  3181  3181 F DEBUG   :       #22 pc 00020a13  /data/app/~~a95bVdqs394MXG64inhuug==/com.vitruvio-W2TTmX4rtM_dbkOexWQsFQ==/lib/x86/libhermes-executor-debug.so (facebook::jsi::Value facebook::jsi::Function::call<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value&&) const+227) (BuildId: 426f3c6108a2991a984a7c7999f8d62d59bf0a73)

"facebook::jsi::Function::call" - I belive that is the promise resolver callback.

I've read some threads this ->
(react-native-community/discussions-and-proposals#91)

Yesterday I was trying to use jsInvoker.invokeAsync() but it crashes. Do you have heard of it right?

@EduFrazao
Copy link
Collaborator

This repository appears to do exactly what we are looking for:

https://github.com/barthap/discovering-turbomodules

At this point:
https://github.com/barthap/discovering-turbomodules/blob/main/cpp/TurboUtilsModule.cpp#L87

What do you think?

@ospfranco
Copy link
Owner Author

Yeah, I noticed when doing a call immediately before the async method it would crash (only on android), and I've been trying to convert the call to a callback, but that also crashes somehow.

Yeah, I remember reading about the callInvoker but I never got it to work, if I remember correctly it also required Turbo Modules, which I never finished figuring it out.

In any case, I don't think I'll manage to get any further this week, if you can get it to work then feel free to open a PR to this PR and I can review it later.

@EduFrazao
Copy link
Collaborator

Yeah, I noticed when doing a call immediately before the async method it would crash (only on android), and I've been trying to convert the call to a callback, but that also crashes somehow.

Yeah, I remember reading about the callInvoker but I never got it to work, if I remember correctly it also required Turbo Modules, which I never finished figuring it out.

In any case, I don't think I'll manage to get any further this week, if you can get it to work then feel free to open a PR to this PR and I can review it later.

Sure. I will continue to work on it this week! Thank you for your code review and this PR.


if (result.type == SequelResultError)
{
resolver->asFunction(rt).call(rt, createError(rt, result.message.c_str()));

Choose a reason for hiding this comment

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

it will not work, you should call js functions in js therad, so you need jsCallbackInvoker from bridge and exec method invokeAsync.
Like here: https://github.com/sergeymild/react-native-jsi-bridge/blob/3ac5415b785fc6f8be51acf630d9958ffa7e6c33/ios/_JsiBridge.mm#L100

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, I've been trying to get fbjni and the callInvoker work in #29 but so far I cannot get android to compile with the jni, looking at your repo, I've tried to replicate the build.gradle and the CMakeLists but it is way too complex for me

Copy link

Choose a reason for hiding this comment

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

i have watched your video on youtube, i know why on android you have a crashes, it because you looked at my code and at logcat errors not very well) to pass java object like jsInvoker to jni you need to rewrite jni communication between java and c++. https://github.com/sergeymild/react-native-jsi-sqlite - here i created temporally library there i did everything like it must be on android. And it works as expected. Also you don't need to rewrite sqlite.cpp. First of all you need create Hybrid c++ class which will be like a mirror of your java class for example SequelModule.java. next do everything like i did.

Choose a reason for hiding this comment

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

currently it's only implemented on android to show you that you did wrong

Copy link
Collaborator

Choose a reason for hiding this comment

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

currently it's only implemented on android to show you that you did wrong

Using your examples, Its working now with this changes:

public class NativeProxy {


  private native void installNativeJsi(long jsContextNativePointer, CallInvokerHolderImpl jsCallInvokerHolder, String docDir);
  public static final NativeProxy instance = new NativeProxy();

  public void installJsi(ReactContext context) {
    Log.d("rn-native-quick-sqlite", "Installing native...");
    CallInvokerHolderImpl holder = (CallInvokerHolderImpl)context.getCatalystInstance().getJSCallInvokerHolder();
    long contextPointer = context.getJavaScriptContextHolder().get();
    final String path = context.getFilesDir().getAbsolutePath();
    installNativeJsi(contextPointer, holder, path);
  }
}
#include <jni.h>
#include <fbjni/fbjni.h>
#include <jsi/jsi.h>
#include <ReactCommon/CallInvokerHolder.h>
#include "react-native-quick-sqlite.h"
#include "logs.h"
#include <typeinfo>

struct NativeProxy : jni::JavaClass<NativeProxy> {
    static constexpr auto kJavaDescriptor = "Lcom/reactnativesequel/NativeProxy;";

    static JavaVM* vm;

    static void registerNatives(JavaVM* v) {
        //NativeProxy::vm = v;
        // register native methods for Java
        javaClassStatic()->registerNatives({
                                                   //initialization for JSI
                                                   makeNativeMethod("installNativeJsi", NativeProxy::installNativeJsi)
                                           });
    }

private:
    static void installNativeJsi(jni::alias_ref<jni::JObject> thiz,
                                 jlong jsiRuntimePtr,
                                 jni::alias_ref<react::CallInvokerHolder::javaobject> jsCallInvokerHolder,
                                 jni::alias_ref<jni::JString> docPath) {

        auto jsiRuntime = reinterpret_cast<jsi::Runtime*>(jsiRuntimePtr);
        auto jsCallInvoker = jsCallInvokerHolder->cthis()->getCallInvoker();
        std::string docPathString = docPath->toStdString();

        installSequel(*jsiRuntime, jsCallInvoker, docPathString.c_str());
    }
};

JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
    return jni::initialize(vm, [vm] {
        NativeProxy::registerNatives(vm);
    });
}

Thank you.

Copy link
Collaborator

@EduFrazao EduFrazao Mar 12, 2022

Choose a reason for hiding this comment

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

@EduFrazao your code looks a lot simpler, would you mind opening a PR so I can review it?

Sure. I will do it right now. In this moment I'm testing the loadSQLFileAsync method. I will submit it in few minutes and let you know if its working. I will test with several files, some of them with more than 120k rows.

Today I run another tests, dispatching more than 500 async calls with a random thread wait time to simulate different workloads. All of them work as expected, and all callbacks works as expected.

Copy link
Owner Author

Choose a reason for hiding this comment

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

well... I got android to compile and I got the call to the callInvoker working, but somehow android it is still crashing. Just open your PR asap, I would like to understand how did you got it working

Copy link
Collaborator

Choose a reason for hiding this comment

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

@EduFrazao your code looks a lot simpler, would you mind opening a PR so I can review it?

Finished my testes here. Async loading of SQLFiles is working, and the applicatoins runs so smooth :).
More than 250k rows background processed, and the UI keeps responsive :).

I will open a PR.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I tried to replicate your changes with a struct but somehow android is crashing for me when I try to register theJSI bindings

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried to replicate your changes with a struct but somehow android is crashing for me when I try to register theJSI bindings

Can I help some how? It fails registering the methods on the sqlite module? I've made tests with the SQLFileLoader and a test method that does nothing, except create some random numbers, put the working thread to sleep (to simulate some workload time).

@ospfranco
Copy link
Owner Author

closing this in favor of #29, there the jsCallInvoker is correctly linked and things are working (on android)

@ospfranco ospfranco closed this Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants