waterbang / Comment

博客评论
GNU General Public License v3.0
0 stars 0 forks source link

今天我想尝试运行更底层的deno_core,同样编译能通过,然而他是直接报错无法运行了 #5

Closed AuTsing closed 2 years ago

AuTsing commented 2 years ago

用的都是官方的 v8 0.42.0 deno_core 0.134.0

具体如下

denoc.rs

use deno_core::JsRuntime;
use deno_core::RuntimeOptions;

pub fn run_main() {
    let mut runtime = JsRuntime::new(RuntimeOptions::default());

    runtime
        .execute_script("<usage>", " Deno.core.print('hello world!');")
        .unwrap();
}

lib.rs

mod denoc;

#[macro_use]
extern crate log;

use android_logger::Config;
use jni::objects::JClass;
use jni::sys::jstring;
use jni::JNIEnv;
use log::Level;

#[no_mangle]
pub extern "C" fn Java_com_atstudio_denouser_MainActivity_stringFromRustJNI(
    env: JNIEnv,
    _thiz: JClass,
) -> jstring {
    env.new_string("String from Rust")
        .expect("Can't get string from env.")
        .into_inner()
}

#[no_mangle]
pub extern "C" fn Java_com_atstudio_denouser_MainActivity_runTest(_env: JNIEnv, _thiz: JClass) {
    android_logger::init_once(Config::default().with_min_level(Level::Trace));
    info!("start runTest");

    denoc::run_main();
}

tombstone

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
crDroid Version: '6.13'
Build fingerprint: 'google/coral/coral:11/RQ1A.201205.008/6943376:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-09-14 14:41:17+0800
pid: 14744, tid: 14744, name: studio.denouser  >>> com.atstudio.denouser <<<
uid: 10240
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    x0  0000000000000000  x1  0000000000003998  x2  0000000000000006  x3  0000007fee963b50
    x4  0000007cf8ac71c8  x5  0000007cf8ac71c8  x6  0000007cf8ac71c8  x7  0000007cf8ac7000
    x8  00000000000000f0  x9  98b67689efe172f8  x10 0000000000000001  x11 0000000000000000
    x12 fffffff0fffffbdf  x13 000000000000147b  x14 0000000000000064  x15 0000007fee963a48
    x16 0000007de7961cd8  x17 0000007de793dd40  x18 0000007de9090000  x19 0000000000003998
    x20 0000000000003998  x21 00000000ffffffff  x22 0000007cfa772d50  x23 0000000000000000
    x24 0000007cfa554fd0  x25 0000000000000001  x26 0000007cfa80fc40  x27 0000000000000001
    x28 0000007fee965bd0  x29 0000007fee963bf0
    sp  0000007fee963b30  lr  0000007de78f0208  pc  0000007de78f0234

backtrace:
      #00 pc 000000000006f234  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: f53db390a32d28bac5f4be824746cf77)
      #01 pc 0000000000f0caf4  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #02 pc 0000000000f0adbc  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #03 pc 0000000000f0ac90  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #04 pc 0000000000f0a9e8  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #05 pc 0000000000f09a2c  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #06 pc 0000000000f0a734  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #07 pc 00000000000ff930  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #08 pc 00000000000ff9d4  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #09 pc 000000000012e194  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #10 pc 00000000001d5bfc  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #11 pc 00000000001002e0  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
      #12 pc 0000000000100500  /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so (Java_com_atstudio_denouser_MainActivity_runTest+204)
      #13 pc 0000000000140350  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #14 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #15 pc 0000000000146050  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #16 pc 00000000002dd178  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+380) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #17 pc 00000000002d8460  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #18 pc 0000000000594b9c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+836) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #19 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #20 pc 0000000000001608  [anon:dalvik-classes4.dex extracted in memory from /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/base.apk!classes4.dex] (com.atstudio.denouser.MainActivity.onCreate+72)
      #21 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #22 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #23 pc 0000000000196bae  /system/framework/framework.jar (android.app.Activity.performCreate+30)
      #24 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #25 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #26 pc 0000000000196b76  /system/framework/framework.jar (android.app.Activity.performCreate+2)
      #27 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #28 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #29 pc 00000000001f69c2  /system/framework/framework.jar (android.app.Instrumentation.callActivityOnCreate+6)
      #30 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #31 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #32 pc 000000000018603c  /system/framework/framework.jar (android.app.ActivityThread.performLaunchActivity+752)
      #33 pc 0000000000597180  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #34 pc 0000000000131914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #35 pc 0000000000185cba  /system/framework/framework.jar (android.app.ActivityThread.handleLaunchActivity+94)
      #36 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #37 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #38 pc 00000000002665fe  /system/framework/framework.jar (android.app.servertransaction.LaunchActivityItem.execute+126)
      #39 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #40 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #41 pc 0000000000268b46  /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.executeCallbacks+154)
      #42 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #43 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #44 pc 0000000000268a82  /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.execute+146)
      #45 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #46 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #47 pc 0000000000184fe6  /system/framework/framework.jar (android.app.ActivityThread$H.handleMessage+78)
      #48 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #49 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #50 pc 00000000002fb352  /system/framework/framework.jar (android.os.Handler.dispatchMessage+38)
      #51 pc 0000000000594df0  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #52 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #53 pc 000000000032069e  /system/framework/framework.jar (android.os.Looper.loop+466)
      #54 pc 000000000059798c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #55 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #56 pc 000000000018e84c  /system/framework/framework.jar (android.app.ActivityThread.main+196)
      #57 pc 00000000002ae1d0  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.18044392206855813000+240) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #58 pc 00000000005861d8  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+772) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #59 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #60 pc 00000000001375b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #61 pc 0000000000146070  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #62 pc 00000000004a0a4c  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #63 pc 00000000004a23d8  /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1320) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #64 pc 0000000000430714  /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #65 pc 0000000000088b24  /system/framework/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 6d7dd3ae0ecebbe9acf57be9dcc914aa6eab56ed)
      #66 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #67 pc 0000000000146050  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #68 pc 00000000002dd178  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+380) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #69 pc 00000000002d8460  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #70 pc 0000000000594b9c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+836) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #71 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #72 pc 00000000003548ea  /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
      #73 pc 00000000002ae1d0  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.18044392206855813000+240) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #74 pc 00000000005861d8  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+772) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #75 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #76 pc 00000000008d2570  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2032) (BuildId: 4b26997ad696a3509f94b0236f4a0132a8a02adb)
      #77 pc 00000000001375b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #78 pc 0000000000146070  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #79 pc 00000000004a0a4c  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #80 pc 00000000004a06b8  /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #81 pc 00000000003b1c20  /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+764) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #82 pc 0000000000364be0  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2488) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #83 pc 00000000003550e4  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+76) (BuildId: c50615026c43cd2e25143c89614cbdcb)
      #84 pc 00000000000bf998  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+116) (BuildId: a81775a7a60ce82a0328a353723299f1)
      #85 pc 00000000000c286c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+780) (BuildId: a81775a7a60ce82a0328a353723299f1)
      #86 pc 00000000000034e0  /system/bin/app_process64 (main+1168) (BuildId: cd40662587b39de89ed5948d2092ecdd)
      #87 pc 000000000006a48c  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: f53db390a32d28bac5f4be824746cf77)

addr2line

********** Crash dump: **********
Build fingerprint: 'google/coral/coral:11/RQ1A.201205.008/6943376:user/release-keys'
#00 0x000000000006f234 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: f53db390a32d28bac5f4be824746cf77)
#01 0x0000000000f0caf4 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
std::sys::unix::abort_internal::h52ff0e515c4c3607
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src/sys/unix\mod.rs:292:14
#02 0x0000000000f0adbc /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
rust_panic
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src\panicking.rs:748:5
#03 0x0000000000f0ac90 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
std::panicking::rust_panic_with_hook::h3966a5673fb16211
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src\panicking.rs:716:5
#04 0x0000000000f0a9e8 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h4953862350c4d327
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src\panicking.rs:588:13
#05 0x0000000000f09a2c /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
std::sys_common::backtrace::__rust_end_short_backtrace::hbe3074a0a45404a4
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src/sys_common\backtrace.rs:138:18
#06 0x0000000000f0a734 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
rust_begin_unwind
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/std/src\panicking.rs:584:5
#07 0x00000000000ff930 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
core::panicking::panic_fmt::h076b5e777927bd62
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/core/src\panicking.rs:142:14
#08 0x00000000000ff9d4 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
core::result::unwrap_failed::hc446277cdf31226b
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f\library/core/src\result.rs:1805:5
#09 0x000000000012e194 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
core::result::Result$LT$T$C$E$GT$::unwrap::heb2256197ffa86e1
/rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src\result.rs:1098:23
#10 0x00000000001d5bfc /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
deno_core::runtime::JsRuntime::new::hc1eca6f7de3a0663
/home/autsing/.cargo/registry/src/github.com-1ecc6299db9ec823/deno_core-0.134.0\runtime.rs:409:7
#11 0x00000000001002e0 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so
denouser::denoc::run_main::h52a43c63853e6bb8
/home/autsing/Gits/denouser\denouser_0_60_0/src\denoc.rs:5:23
#12 0x0000000000100500 /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/lib/arm64/libdenouser.so (Java_com_atstudio_denouser_MainActivity_runTest+204)
                                                                                                          Java_com_atstudio_denouser_MainActivity_runTest
                                                                                                          /home/autsing/Gits/denouser\denouser_0_60_0/src\lib.rs:27:5
#13 0x0000000000140350 /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#14 0x0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#15 0x0000000000146050 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#16 0x00000000002dd178 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+380) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#17 0x00000000002d8460 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#18 0x0000000000594b9c /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+836) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#19 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#20 0x0000000000001608 [anon:dalvik-classes4.dex extracted in memory from /data/app/com.atstudio.denouser-GO8ydIXjYfiijbirc_hp2A==/base.apk!classes4.dex] (com.atstudio.denouser.MainActivity.onCreate+72)
#21 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#22 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#23 0x0000000000196bae /system/framework/framework.jar (android.app.Activity.performCreate+30)
#24 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#25 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#26 0x0000000000196b76 /system/framework/framework.jar (android.app.Activity.performCreate+2)
#27 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#28 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#29 0x00000000001f69c2 /system/framework/framework.jar (android.app.Instrumentation.callActivityOnCreate+6)
#30 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#31 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#32 0x000000000018603c /system/framework/framework.jar (android.app.ActivityThread.performLaunchActivity+752)
#33 0x0000000000597180 /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#34 0x0000000000131914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#35 0x0000000000185cba /system/framework/framework.jar (android.app.ActivityThread.handleLaunchActivity+94)
#36 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#37 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#38 0x00000000002665fe /system/framework/framework.jar (android.app.servertransaction.LaunchActivityItem.execute+126)
#39 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#40 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#41 0x0000000000268b46 /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.executeCallbacks+154)
#42 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#43 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#44 0x0000000000268a82 /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.execute+146)
#45 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#46 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#47 0x0000000000184fe6 /system/framework/framework.jar (android.app.ActivityThread$H.handleMessage+78)
#48 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#49 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#50 0x00000000002fb352 /system/framework/framework.jar (android.os.Handler.dispatchMessage+38)
#51 0x0000000000594df0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#52 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#53 0x000000000032069e /system/framework/framework.jar (android.os.Looper.loop+466)
#54 0x000000000059798c /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#55 0x0000000000131994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#56 0x000000000018e84c /system/framework/framework.jar (android.app.ActivityThread.main+196)
#57 0x00000000002ae1d0 /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.18044392206855813000+240) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#58 0x00000000005861d8 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+772) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#59 0x0000000000140468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#60 0x00000000001375b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#61 0x0000000000146070 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#62 0x00000000004a0a4c /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#63 0x00000000004a23d8 /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1320) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#64 0x0000000000430714 /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#65 0x0000000000088b24 /system/framework/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 6d7dd3ae0ecebbe9acf57be9dcc914aa6eab56ed)
#66 0x0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#67 0x0000000000146050 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#68 0x00000000002dd178 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+380) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#69 0x00000000002d8460 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#70 0x0000000000594b9c /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+836) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#71 0x0000000000131814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#72 0x00000000003548ea /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
#73 0x00000000002ae1d0 /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.18044392206855813000+240) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#74 0x00000000005861d8 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+772) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#75 0x0000000000140468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#76 0x00000000008d2570 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2032) (BuildId: 4b26997ad696a3509f94b0236f4a0132a8a02adb)
#77 0x00000000001375b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#78 0x0000000000146070 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#79 0x00000000004a0a4c /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#80 0x00000000004a06b8 /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#81 0x00000000003b1c20 /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+764) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#82 0x0000000000364be0 /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2488) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#83 0x00000000003550e4 /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+76) (BuildId: c50615026c43cd2e25143c89614cbdcb)
#84 0x00000000000bf998 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+116) (BuildId: a81775a7a60ce82a0328a353723299f1)
#85 0x00000000000c286c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+780) (BuildId: a81775a7a60ce82a0328a353723299f1)
#86 0x00000000000034e0 /system/bin/app_process64 (main+1168) (BuildId: cd40662587b39de89ed5948d2092ecdd)
#87 0x000000000006a48c /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: f53db390a32d28bac5f4be824746cf77)
Crash dump is completed

根据报错的内容我已经翻到了我能定位到的具体位置了 runtime.rs

    if !has_startup_snapshot {
      let realm = js_runtime.global_realm();
      js_runtime.init_extension_js(&realm).unwrap();  //就是这一行报的错误
    }

😂又没有思路了,请问你这边看了有没有什么指导意见?

waterbang commented 2 years ago

你好,指导不敢当,这里也遇到了跟你一样的错误:https://github.com/denoland/deno/issues/13936

  1. 你用 addr2line定位了报错的位置吗?我上次用过,不过偏移地址都是虚拟地址,定位出来都是错误的。
AuTsing commented 2 years ago
  1. 真机,是ARM64的

  2. 编译好的so直接放在工程目录 工程目录为 D:\OneDrive\Gits\Java\DenoUser 具体目录为 D:\OneDrive\Gits\Java\DenoUser\app\libs\arm64-v8a

  3. 编译命令为 build.sh

    
    #!/bin/bash

export CC=/home/autsing/Apps/androidSdk/ndk/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang export AR=/home/autsing/Apps/androidSdk/ndk/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=/home/autsing/Apps/androidSdk/ndk/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang

cargo build --target aarch64-linux-android

cp ./target/aarch64-linux-android/debug/libdenouser.so ~/OneDrive/Gits/Java/DenoUser/app/libs/arm64-v8a/


4. 有使用addr2line定位错误的,具体可以看上面一楼,我感觉应该没有错的,是在
_runtime.rs_
```rust
    if !has_startup_snapshot {
      let realm = js_runtime.global_realm();
      js_runtime.init_extension_js(&realm).unwrap();  //就是这一行报的错误
    }
  1. 这个例子我尝试过运行过,我最后简化成 denoc.rs
    
    use deno_core::JsRuntime;
    use deno_core::RuntimeOptions;

pub fn run_main() { let mut runtime = JsRuntime::new(RuntimeOptions::default());

runtime
    .execute_script("<usage>", " Deno.core.print('hello world!');")
    .unwrap();

}


是报相同的错误的
AuTsing commented 2 years ago

根据你上面给到的链接 https://github.com/denoland/deno/issues/13936#issuecomment-1095327823 这一条似乎给到了我一些思路

AuTsing commented 2 years ago

似乎并不奏效,我把测试代码简化成

use deno_core::JsRuntime;
use deno_core::RuntimeOptions;

pub fn run_main() {
    JsRuntime::new(RuntimeOptions::default());
}

但他依然会报错,并且我根据他所说的,另起一个线程,依然会报相同的错误😂

Thread {
    Log.d(TAG, "onCreate: ${stringFromRustJNI()}")
    runTest()
}.start()
waterbang commented 2 years ago

似乎并不奏效,我把测试代码简化成

use deno_core::JsRuntime;
use deno_core::RuntimeOptions;

pub fn run_main() {
    JsRuntime::new(RuntimeOptions::default());
}

但他依然会报错,并且我根据他所说的,另起一个线程,依然会报相同的错误😂

Thread {
    Log.d(TAG, "onCreate: ${stringFromRustJNI()}")
    runTest()
}.start()

你要不要把代码提交一下,我也试试看行不行😂

waterbang commented 2 years ago

我每次遇到signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr这种错误,都是js代码有问题,要不要尝试这个看看:

fn main() {
  let mut runtime = JsRuntime::new(RuntimeOptions::default());

  // Evaluate some code
  let code = "let a = 1+4; a*2";
  let output: serde_json::Value =
    eval(&mut runtime, code).expect("Eval failed");

  println!("Output: {:?}", output);

  let expected_output = serde_json::json!(10);
  assert_eq!(expected_output, output);
}

fn eval(
  context: &mut JsRuntime,
  code: &str,
) -> Result<serde_json::Value, String> {
  let res = context.execute_script("<anon>", code);
  match res {
    Ok(global) => {
      let scope = &mut context.handle_scope();
      let local = v8::Local::new(scope, global);
      // Deserialize a `v8` object into a Rust type using `serde_v8`,
      // in this case deserialize to a JSON `Value`.
      let deserialized_value =
        serde_v8::from_v8::<serde_json::Value>(scope, local);

      match deserialized_value {
        Ok(value) => Ok(value),
        Err(err) => Err(format!("Cannot deserialize value: {:?}", err)),
      }
    }
    Err(err) => Err(format!("Evaling error: {:?}", err)),
  }
}
AuTsing commented 2 years ago

目前就我的纯个人想法 就根据你之前所说的,你说是快照出现问题,我猜问题就出现在这个快照这里 我单独运行v8的demo是不会报错的 而在v8的上一层也就是在deno_core这一层出现了错误 对于deno_core我没有仔细阅读这里面的代码,但在这一层似乎就已经用到了快照 上面的报错的堆栈追踪似乎也看到了快照的踪影 而你说使用ARM64进行编译就没有问题 根据官方的说法,快照是不能交叉编译的 所以我就大致猜测会不会就是编译导致的

所以我目前的想法就是想尝试先在ARM64下编译看看 因为docker用得比较少而且没有尝试过模拟平台,所以进度有点缓慢😂

我这边的demo稍后上传上来,你也可以试下能不能复现

AuTsing commented 2 years ago

demo在这里,你这边可以试下 https://github.com/AuTsing/denouser https://github.com/AuTsing/denouser-app

waterbang commented 2 years ago

目前就我的纯个人想法 就根据你之前所说的,你说是快照出现问题,我猜问题就出现在这个快照这里 我单独运行v8的demo是不会报错的 而在v8的上一层也就是在deno_core这一层出现了错误 对于deno_core我没有仔细阅读这里面的代码,但在这一层似乎就已经用到了快照 上面的报错的堆栈追踪似乎也看到了快照的踪影 而你说使用ARM64进行编译就没有问题 根据官方的说法,快照是不能交叉编译的 所以我就大致猜测会不会就是编译导致的

所以我目前的想法就是想尝试先在ARM64下编译看看 因为docker用得比较少而且没有尝试过模拟平台,所以进度有点缓慢😂

我这边的demo稍后上传上来,你也可以试下能不能复现

你v8的版本不是0.42.0吗?这个官方是有v8的android的库,这个我也是在x86 架构下构建的so文件。我就是rusty_v8升级到了0.48.1,然后在x86架构下交叉编译aarch64-linux-android版本的动态链接库,然后运行的时候报虚拟地址错误。而在arm64架构下交叉编译动态链接库就没问题。

上面说的快照不能交叉编译是在哪里,贴个链接看看。

AuTsing commented 2 years ago

是在官方仓库的build脚本里面看到的 https://github.com/denoland/deno/blob/main/cli/build.rs 第331行

waterbang commented 2 years ago

根据你上面给到的链接 denoland/deno#13936 (comment) 这一条似乎给到了我一些思路

这个老哥说的不错,我提交一下,你看就懂了

image
AuTsing commented 2 years ago

OKOK,我先仔细研究一下

waterbang commented 2 years ago

OKOK,我先仔细研究一下

OK,提交pr了

AuTsing commented 2 years ago

我跑了一下程序没有崩,但是似乎也没有输出? image

waterbang commented 2 years ago

啊组件可能没加载到,我看看

waterbang commented 2 years ago

不能直接调用:deno_core_main::run_main();

你这样deno不知道你要运行什么模块,所以直接报错。参考:这里的写法https://github.com/denoland/deno/blob/main/runtime/examples/hello_runtime.rs

把要运行的js传递过去

AuTsing commented 2 years ago

我明白你的意思 但是 deno_runtime 不是对 deno_core 的封装吗? 官方也有运行 deno_core 的例子呀 https://github.com/denoland/deno/blob/main/core/examples/hello_world.rs

我试过运行 deno_runtime ,但是运行他会报 unreachable code 的错误 所以我才想尝试运行更底层的 deno_core 来定位错误

我的 https://github.com/AuTsing/denouser 里面分别有三个文件main文件,分别是调用 对 v8,deno_core,deno_runtime 的测试,其中只有 v8 是不会报错的,其余两个会报错

其中 deno_core 报错的问题,我把 demo 测试删减到最简了

use deno_core::JsRuntime;
use deno_core::RuntimeOptions;

pub fn run_main() {
    JsRuntime::new(RuntimeOptions::default());
}

这样依然报错了,这个错误似乎是在 JsRuntime 初始化过程中出现的 这里只有一句代码就是初始化一个 JsRuntime 这说明这个错误应该是来自于初始化的了吧

如果你想复现我测试 deno_runtime 出现的错误你可以把我 denouser 修改后编译就能复现问题了 image

waterbang commented 2 years ago

我觉得你说的很有道理,是我想错了。

还有就是直接引入deno_runtime是不行的,你需要在deno_runtime里面注释调deno_webgpu和deno_ffi这里是某些ABI缺失了。

我在想deno_code 是不是也是这么回事,我魔改了deno_code也是不行,我提个pr你看看,一直出现:

A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 26205 (IntentService[D), pid 26174 (studio.denouser)

我觉得是jsRuntime超出了jni调用的限制.因为我运行test是通过的。

image
AuTsing commented 2 years ago

是的,我 test 也是没有任何错误的,具体我估计还得仔细阅读源码才能确认问题所在

至于 deno_runtime 没法直接引入的问题,我觉得起码得先搞定 deno_core 吧,如果 deno_core 的报错都没法搞定,那 deno_runtime 出现问题的话也不好解决了