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

Frames of my crate disappears completely for some of the code; extreme case: add some useless code to function, then frames disappear #445

Open
fzyzcjy opened this issue Oct 14, 2021 · 11 comments
Labels

Comments

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Oct 14, 2021

EDIT: For a smaller example, see a commit below. I have added a small example that you can run.

Hi thanks for this lib! Yesterday's solution work pretty well, but then I encounter a problem. Sometimes, the stack is complete. However, it only works for some of my code, while the rest of my code cannot output full backtrace but missing many frames. An extreme example is shown below - even if I only add some dummy code that is useless, the stack trace is incomplete, and the frames of my crate just disappears completely. I mean, the unwinding step has problems - since the function address itself just disappears completely.

This is very annoying and I cannot use backtrace-rs at all in production environment if it just output no frames that I need... Any help is appreciated!

  • I have tried RUSTFLAGS="-Cforce-unwind-tables" but no change.
  • It is built in --release mode. (if in debug mode it is ok; but definitely we should build in release mode for prod app)

@kjvalencik Hi could you please give some suggestions? Thanks!
May also related: @bjorn3 @alexcrichton Not sure whether this is in your field; could you please also give some suggestions? Thanks!

For example, my old function:

pub fn print_backtrace(name: &str) {
    // https://docs.rs/backtrace/0.3.61/backtrace/
    backtrace::trace(|frame| {
        info!("{}:capture_and_print_backtrace frame={:?}", name, frame);
        backtrace::resolve_frame(frame, |symbol| {
            info!(
                "{}:capture_and_print_backtrace resolve_frame symbol={:?}",
                name, symbol
            );
        });
        true // keep going to the next frame
    });
}

yields stack trace (just focus on the stack trace itself, ignore other noise; the log is folded)

2021-10-13 21:12:02.560 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::api: debug_throw start mode=RETURN_ERR
2021-10-13 21:12:02.560 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ace53fe, symbol_address: 0x8ace53fe }
2021-10-13 21:12:05.813 11873-11995/com.rzzsdxx.vision_utils_example I/flutter: 2021-10-13T13:12:05.813218Z|D|native_vision_utils|(Flutter) execute [rust_set_up] end delta_time=3345ms
2021-10-13 21:12:06.042 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::libunwind::trace::h7bed50570db63519, addr: 0x6e3fd, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/libunwind.rs", lineno: 90 }
2021-10-13 21:12:06.043 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace_unsynchronized::h47ecba1d8e0604fa, addr: 0x6e3fd, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs", lineno: 66 }
2021-10-13 21:12:06.043 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ace5442, symbol_address: 0x8ace5442 }
2021-10-13 21:12:06.045 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace::h5444619d6cfbf60f, addr: 0x6e441, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs", lineno: 53 }
2021-10-13 21:12:06.045 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad32e0e, symbol_address: 0x8ad32e0e }
2021-10-13 21:12:06.053 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::utils::print_backtrace::h36fccf5225c39180, addr: 0xbbe0d, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/utils.rs", lineno: 97 }
2021-10-13 21:12:06.053 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad25ac4, symbol_address: 0x8ad25ac4 }
2021-10-13 21:12:06.075 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::api::debug_throw::hd14c3dfc2b696304, addr: 0xaeac3, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/api.rs", lineno: 208 }
2021-10-13 21:12:06.076 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad2f0b6, symbol_address: 0x8ad2f0b6 }
2021-10-13 21:12:06.083 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::bridge_generated::wire_debug_throw::{{closure}}::hcc6d0110e4d966ab, addr: 0xb80b5, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/bridge_generated.rs", lineno: 260 }
2021-10-13 21:12:06.083 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad323cc, symbol_address: 0x8ad323cc }
2021-10-13 21:12:06.099 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: flutter_rust_bridge::support::wrap_wire_func::{{closure}}::h98c6ccc1696f99a0, addr: 0xbb3cb, filename: "/Users/tom/QAPMain/TomLib/flutter_rust_bridge/frb_rust/src/support.rs", lineno: 49 }
2021-10-13 21:12:06.099 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad20848, symbol_address: 0x8ad20848 }
2021-10-13 21:12:06.178 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h399616c914b8de5d, addr: 0xa9847, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs", lineno: 227 }
2021-10-13 21:12:06.179 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b255cea, symbol_address: 0x8b255cea }
2021-10-13 21:12:06.189 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8ec260a4f075954e, addr: 0x5dece9, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-13 21:12:06.190 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8acdde20, symbol_address: 0x8acdde20 }
2021-10-13 21:12:06.197 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}::h1cfda29cf54f862a, addr: 0x66e1f, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs", lineno: 32 }
2021-10-13 21:12:06.198 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad10252, symbol_address: 0x8ad10252 }
2021-10-13 21:12:06.213 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::do_call::h5f6da73711b84945, addr: 0x99251, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 401 }
2021-10-13 21:12:06.214 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad1076a, symbol_address: 0x8ad1076a }
2021-10-13 21:12:06.214 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__rust_try" }
2021-10-13 21:12:06.215 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8ad0fbfe, symbol_address: 0x8ad0fbfe }
2021-10-13 21:12:06.216 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::h65909ebd0b4abdc7, addr: 0x98bfd, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 365 }
2021-10-13 21:12:06.216 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8acdf692, symbol_address: 0x8acdf692 }
2021-10-13 21:12:06.225 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panic::catch_unwind::hb45f81122dda5e85, addr: 0x68691, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 434 }
2021-10-13 21:12:06.226 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8acde1c6, symbol_address: 0x8acde1c6 }
2021-10-13 21:12:06.227 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::h0a86cdfaa8b785ba, addr: 0x671c5, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs", lineno: 26 }
2021-10-13 21:12:06.228 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8acddccc, symbol_address: 0x8acddccc }
2021-10-13 21:12:06.229 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <F as threadpool::FnBox>::call_box::he539a2bd49dc7044, addr: 0x66ccb, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs", lineno: 95 }
2021-10-13 21:12:06.230 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b2681b6, symbol_address: 0x8b2681b6 }
2021-10-13 21:12:06.243 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: threadpool::spawn_in_pool::{{closure}}::h4c47ea76e9505103, addr: 0x5f11b5, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs", lineno: 769 }
2021-10-13 21:12:06.244 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b26068e, symbol_address: 0x8b26068e }
2021-10-13 21:12:06.262 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys_common::backtrace::__rust_begin_short_backtrace::h2529928d531913e2, addr: 0x5e968d, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs", lineno: 125 }
2021-10-13 21:12:06.262 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b265638, symbol_address: 0x8b265638 }
2021-10-13 21:12:06.278 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h1cff6cad834613c7, addr: 0x5ee637, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs", lineno: 476 }
2021-10-13 21:12:06.278 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b262606, symbol_address: 0x8b262606 }
2021-10-13 21:12:06.291 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h17d7c22d593f76c5, addr: 0x5eb605, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 347 }
2021-10-13 21:12:06.292 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b269950, symbol_address: 0x8b269950 }
2021-10-13 21:12:06.304 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::do_call::hbd7d89dcbf3a96d4, addr: 0x5f294f, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 401 }
2021-10-13 21:12:06.304 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b26a060, symbol_address: 0x8b26a060 }
2021-10-13 21:12:06.305 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__rust_try" }
2021-10-13 21:12:06.305 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b2698f0, symbol_address: 0x8b2698f0 }
2021-10-13 21:12:06.306 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::hbe99dc32967900a2, addr: 0x5f28ef, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 365 }
2021-10-13 21:12:06.307 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b26262e, symbol_address: 0x8b26262e }
2021-10-13 21:12:06.308 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panic::catch_unwind::ha53cd05bde2fa993, addr: 0x5eb62d, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 434 }
2021-10-13 21:12:06.308 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b265550, symbol_address: 0x8b265550 }
2021-10-13 21:12:06.309 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::thread::Builder::spawn_unchecked::{{closure}}::hdd9e4661873287fc, addr: 0x5ee54f, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs", lineno: 475 }
2021-10-13 21:12:06.310 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b2608ee, symbol_address: 0x8b2608ee }
2021-10-13 21:12:06.311 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::hcd3e1586bbca9ade, addr: 0x5e98ed, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs", lineno: 227 }
2021-10-13 21:12:06.312 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0x8b3e3340, symbol_address: 0x8b3e3340 }
2021-10-13 21:12:06.817 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h38ec0cb28a956262, addr: 0x76c33f, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-13 21:12:06.818 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h217f23e1a784a072, addr: 0x76c33f, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-13 21:12:06.819 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys::unix::thread::Thread::new::thread_start::h50b9a01d25980cc1, addr: 0x76c33f, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs", lineno: 74 }
2021-10-13 21:12:06.820 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0xb2a3f394, symbol_address: 0xb2a3f394 }
2021-10-13 21:12:06.838 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: "_ZL15__pthread_startPv" }
2021-10-13 21:12:06.838 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace frame=Frame { ip: 0xb2a11abe, symbol_address: 0xb2a11abe }
2021-10-13 21:12:06.838 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__start_thread" }
2021-10-13 21:12:06.839 11873-12051/com.rzzsdxx.vision_utils_example I/vision_utils_rs::frb_..: (Rust) execute [debug_throw] end delta_time=4279ms
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter: catch error for debugThrow e=FfiException(GENERAL_ERROR, debug_throw: return Err
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter: Stack backtrace:
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    0: backtrace::backtrace::libunwind::trace
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/libunwind.rs:90:5
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:       backtrace::backtrace::trace_unsynchronized
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:66:5
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    1: backtrace::backtrace::trace
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:53:14
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    2: anyhow::backtrace::capture::Backtrace::create
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/backtrace.rs:216:13
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    3: anyhow::backtrace::capture::Backtrace::capture
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/backtrace.rs:204:17
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    4: anyhow::private::new_adhoc
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/lib.rs:634:36
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    5: vision_utils_rs::api::debug_throw
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/api.rs:210:29
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    6: vision_utils_rs::bridge_generated::wire_debug_throw::{{closure}}
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/bridge_generated.rs:260:17
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    7: flutter_rust_bridge::support::wrap_wire_func::{{closure}}
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/TomLib/flutter_rust_bridge/frb_rust/src/support.rs:49:26
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    8: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:    9: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   10: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs:32:31
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   11: std::panicking::try::do_call
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   12: __rust_try
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   13: std::panicking::try
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   14: std::panic::catch_unwind
2021-10-13 21:12:07.161 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   15: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs:26:37
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   16: <F as threadpool::FnBox>::call_box
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs:95:9
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   17: threadpool::spawn_in_pool::{{closure}}
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs:769:17
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   18: std::sys_common::backtrace::__rust_begin_short_backtrace
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:125:18
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   19: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs:476:17
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   20: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:347:9
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   21: std::panicking::try::do_call
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   22: __rust_try
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   23: std::panicking::try
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   24: std::panic::catch_unwind
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   25: std::thread::Builder::spawn_unchecked::{{closure}}
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs:475:30
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   26: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   27: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:       <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:       std::sys::unix::thread::Thread::new::thread_start
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs:74:17
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   28: _ZL15__pthread_startPv
2021-10-13 21:12:07.162 11873-11995/com.rzzsdxx.vision_utils_example I/flutter:   29: __start_thread, null)

However, with following:

pub fn print_backtrace(name: &str) {
    // https://docs.rs/backtrace/0.3.61/backtrace/
    backtrace::trace(|frame| {
        info!("{}:capture_and_print_backtrace frame={:?}", name, frame);
        backtrace::resolve_frame(frame, |symbol| {
            info!(
                "{}:capture_and_print_backtrace resolve_frame symbol={:?}",
                name, symbol
            );
        });
        true // keep going to the next frame
    });

    fn silly_function(i: i32) -> i32 {
        if rand::random::<f32>() < 0.9 {
            silly_function(i + 1)
        } else {
            i
        }
    }
    info!("silly_function={}", silly_function(5));
}

it becomes:

2021-10-14 13:45:59.166 4372-4407/? I/vision_utils_rs::frb_..: (Rust) execute [debug_throw] start
2021-10-14 13:45:59.166 4372-4407/? I/vision_utils_rs::api: debug_throw start mode=RETURN_ERR
2021-10-14 13:45:59.166 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x9517b5e8, symbol_address: 0x9517b5e8 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace::h82697e41854c3362 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x95177156, symbol_address: 0x95177156 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h79c5052a4520f5b2 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x95175b7c, symbol_address: 0x95175b7c }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}::h0d161ad4a588fc20 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x9519ce26, symbol_address: 0x9519ce26 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <F as threadpool::FnBox>::call_box::h54b5369c4a4dbb70 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x953b0400, symbol_address: 0x953b0400 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys_common::backtrace::__rust_begin_short_backtrace::h2e5af7d5bdba07b5 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x953b18a0, symbol_address: 0x953b18a0 }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h2231d2ec5075a65b }
2021-10-14 13:45:59.167 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x95406068, symbol_address: 0x95406068 }
2021-10-14 13:45:59.207 4372-4390/? I/flutter: 2021-10-14T05:45:59.207356Z|D|native_vision_utils|(Flutter) execute [rust_set_up] end delta_time=282ms
2021-10-14 13:45:59.221 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h38ec0cb28a956262, addr: 0x2fd067, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 13:45:59.221 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h217f23e1a784a072, addr: 0x2fd067, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 13:45:59.222 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys::unix::thread::Thread::new::thread_start::h50b9a01d25980cc1, addr: 0x2fd067, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs", lineno: 74 }
2021-10-14 13:45:59.222 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0xb2a3f394, symbol_address: 0xb2a3f394 }
2021-10-14 13:45:59.223 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "_ZL15__pthread_startPv" }
2021-10-14 13:45:59.223 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0xb2a11abe, symbol_address: 0xb2a11abe }
2021-10-14 13:45:59.223 4372-4407/? I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__start_thread" }
2021-10-14 13:45:59.223 4372-4407/? I/vision_utils_rs::utils: silly_function=12
2021-10-14 13:45:59.223 4372-4407/? I/vision_utils_rs::frb_..: (Rust) execute [debug_throw] end delta_time=57ms
2021-10-14 13:45:59.283 4372-4390/? I/flutter: catch error for debugThrow e=FfiException(GENERAL_ERROR, debug_throw: return Err
2021-10-14 13:45:59.283 4372-4390/? I/flutter: Stack backtrace:
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    0: backtrace::backtrace::trace
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    1: anyhow::backtrace::capture::Backtrace::capture
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    2: anyhow::private::new_adhoc
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    3: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    4: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    5: <F as threadpool::FnBox>::call_box
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    6: std::sys_common::backtrace::__rust_begin_short_backtrace
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    7: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    8: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-14 13:45:59.283 4372-4390/? I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-14 13:45:59.283 4372-4390/? I/flutter:       <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-14 13:45:59.283 4372-4390/? I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-14 13:45:59.283 4372-4390/? I/flutter:       std::sys::unix::thread::Thread::new::thread_start
2021-10-14 13:45:59.283 4372-4390/? I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs:74:17
2021-10-14 13:45:59.283 4372-4390/? I/flutter:    9: _ZL15__pthread_startPv
2021-10-14 13:45:59.283 4372-4390/? I/flutter:   10: __start_thread, null

With the dummy function, but in debug mode: it works


2021-10-14 14:09:22.234 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::api: debug_throw start mode=RETURN_ERR
2021-10-14 14:09:22.234 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa64d74, symbol_address: 0x8aa64d74 }
2021-10-14 14:09:22.236 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::libunwind::trace::h7bed50570db63519, addr: 0x6dd73, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/libunwind.rs", lineno: 90 }
2021-10-14 14:09:22.237 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace_unsynchronized::hfaf0ce8f98323a2b, addr: 0x6dd73, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs", lineno: 66 }
2021-10-14 14:09:22.238 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa64dbc, symbol_address: 0x8aa64dbc }
2021-10-14 14:09:22.239 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace::h79ed2ad04f76964f, addr: 0x6ddbb, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs", lineno: 53 }
2021-10-14 14:09:22.240 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa7db2e, symbol_address: 0x8aa7db2e }
2021-10-14 14:09:22.242 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::utils::print_backtrace::hb233a954894545c4, addr: 0x86b2d, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/utils.rs", lineno: 98 }
2021-10-14 14:09:22.243 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aaa831a, symbol_address: 0x8aaa831a }
2021-10-14 14:09:22.269 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::api::debug_throw::hf3ae3618502ab64a, addr: 0xb1319, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/api.rs", lineno: 208 }
2021-10-14 14:09:22.270 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa9c06a, symbol_address: 0x8aa9c06a }
2021-10-14 14:09:22.277 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: vision_utils_rs::bridge_generated::wire_debug_throw::{{closure}}::h84e6e1d2d8ad4f9e, addr: 0xa5069, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/bridge_generated.rs", lineno: 260 }
2021-10-14 14:09:22.278 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa60844, symbol_address: 0x8aa60844 }
2021-10-14 14:09:22.279 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: flutter_rust_bridge::support::wrap_wire_func::{{closure}}::h093121b9c7de6b12, addr: 0x69843, filename: "/Users/tom/QAPMain/TomLib/flutter_rust_bridge/frb_rust/src/support.rs", lineno: 49 }
2021-10-14 14:09:22.279 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa7ef66, symbol_address: 0x8aa7ef66 }
2021-10-14 14:09:22.352 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h82c7d8c2695dae13, addr: 0x87f65, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs", lineno: 227 }
2021-10-14 14:09:22.352 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afd5d62, symbol_address: 0x8afd5d62 }
2021-10-14 14:09:22.363 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8ec260a4f075954e, addr: 0x5ded61, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 14:09:22.363 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa61fd8, symbol_address: 0x8aa61fd8 }
2021-10-14 14:09:22.370 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}::h25f8f464bb00b1b7, addr: 0x6afd7, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs", lineno: 35 }
2021-10-14 14:09:22.371 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa634f2, symbol_address: 0x8aa634f2 }
2021-10-14 14:09:22.386 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::do_call::h7576da404d2653b4, addr: 0x6c4f1, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 401 }
2021-10-14 14:09:22.386 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa638ba, symbol_address: 0x8aa638ba }
2021-10-14 14:09:22.387 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__rust_try" }
2021-10-14 14:09:22.387 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa62e7a, symbol_address: 0x8aa62e7a }
2021-10-14 14:09:22.388 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::h68bdcb2b67bb7a6a, addr: 0x6be79, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 365 }
2021-10-14 14:09:22.389 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa7cf98, symbol_address: 0x8aa7cf98 }
2021-10-14 14:09:22.398 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panic::catch_unwind::hd37c962b63250df9, addr: 0x85f97, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 434 }
2021-10-14 14:09:22.398 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa6237e, symbol_address: 0x8aa6237e }
2021-10-14 14:09:22.400 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::h2946d6258cd18ee8, addr: 0x6b37d, filename: "/Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs", lineno: 29 }
2021-10-14 14:09:22.400 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8aa61e82, symbol_address: 0x8aa61e82 }
2021-10-14 14:09:22.401 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <F as threadpool::FnBox>::call_box::h17da844fbc109b39, addr: 0x6ae81, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs", lineno: 95 }
2021-10-14 14:09:22.402 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe822e, symbol_address: 0x8afe822e }
2021-10-14 14:09:22.415 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: threadpool::spawn_in_pool::{{closure}}::h4c47ea76e9505103, addr: 0x5f122d, filename: "/Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs", lineno: 769 }
2021-10-14 14:09:22.416 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe0706, symbol_address: 0x8afe0706 }
2021-10-14 14:09:22.434 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys_common::backtrace::__rust_begin_short_backtrace::h2529928d531913e2, addr: 0x5e9705, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs", lineno: 125 }
2021-10-14 14:09:22.435 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe56b0, symbol_address: 0x8afe56b0 }
2021-10-14 14:09:22.452 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h1cff6cad834613c7, addr: 0x5ee6af, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs", lineno: 476 }
2021-10-14 14:09:22.452 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe267e, symbol_address: 0x8afe267e }
2021-10-14 14:09:22.465 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h17d7c22d593f76c5, addr: 0x5eb67d, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 347 }
2021-10-14 14:09:22.466 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe99c8, symbol_address: 0x8afe99c8 }
2021-10-14 14:09:22.477 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::do_call::hbd7d89dcbf3a96d4, addr: 0x5f29c7, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 401 }
2021-10-14 14:09:22.477 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afea0d8, symbol_address: 0x8afea0d8 }
2021-10-14 14:09:22.478 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__rust_try" }
2021-10-14 14:09:22.479 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe9968, symbol_address: 0x8afe9968 }
2021-10-14 14:09:22.480 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panicking::try::hbe99dc32967900a2, addr: 0x5f2967, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs", lineno: 365 }
2021-10-14 14:09:22.480 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe26a6, symbol_address: 0x8afe26a6 }
2021-10-14 14:09:22.481 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::panic::catch_unwind::ha53cd05bde2fa993, addr: 0x5eb6a5, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs", lineno: 434 }
2021-10-14 14:09:22.481 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe55c8, symbol_address: 0x8afe55c8 }
2021-10-14 14:09:22.483 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::thread::Builder::spawn_unchecked::{{closure}}::hdd9e4661873287fc, addr: 0x5ee5c7, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs", lineno: 475 }
2021-10-14 14:09:22.483 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8afe0966, symbol_address: 0x8afe0966 }
2021-10-14 14:09:22.484 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::hcd3e1586bbca9ade, addr: 0x5e9965, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs", lineno: 227 }
2021-10-14 14:09:22.485 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0x8b1633b8, symbol_address: 0x8b1633b8 }
2021-10-14 14:09:22.993 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h38ec0cb28a956262, addr: 0x76c3b7, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 14:09:22.994 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h217f23e1a784a072, addr: 0x76c3b7, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 14:09:22.995 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys::unix::thread::Thread::new::thread_start::h50b9a01d25980cc1, addr: 0x76c3b7, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs", lineno: 74 }
2021-10-14 14:09:22.996 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0xb2a3f394, symbol_address: 0xb2a3f394 }
2021-10-14 14:09:23.014 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "_ZL15__pthread_startPv" }
2021-10-14 14:09:23.014 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace frame=Frame { ip: 0xb2a11abe, symbol_address: 0xb2a11abe }
2021-10-14 14:09:23.014 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: inside-api-debug_throw:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__start_thread" }
2021-10-14 14:09:23.015 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::utils: silly_function=24
2021-10-14 14:09:23.015 5510-5624/com.rzzsdxx.vision_utils_example I/vision_utils_rs::frb_..: (Rust) execute [debug_throw] end delta_time=782ms
2021-10-14 14:09:24.900 5510-5598/com.rzzsdxx.vision_utils_example I/flutter: 2021-10-14T06:09:24.900245Z|D|native_vision_utils|(Flutter) execute [rust_set_up] end delta_time=6184ms
2021-10-14 14:09:25.094 5510-5598/com.rzzsdxx.vision_utils_example I/flutter: catch error for debugThrow e=FfiException(GENERAL_ERROR, debug_throw: return Err
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter: Stack backtrace:
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    0: backtrace::backtrace::libunwind::trace
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/libunwind.rs:90:5
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:       backtrace::backtrace::trace_unsynchronized
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:66:5
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    1: backtrace::backtrace::trace
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:53:14
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    2: anyhow::backtrace::capture::Backtrace::create
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/backtrace.rs:216:13
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    3: anyhow::backtrace::capture::Backtrace::capture
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/backtrace.rs:204:17
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    4: anyhow::private::new_adhoc
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.44/src/lib.rs:634:36
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    5: vision_utils_rs::api::debug_throw
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/api.rs:210:29
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    6: vision_utils_rs::bridge_generated::wire_debug_throw::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/bridge_generated.rs:260:17
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    7: flutter_rust_bridge::support::wrap_wire_func::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/TomLib/flutter_rust_bridge/frb_rust/src/support.rs:49:26
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    8: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:    9: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   10: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs:35:31
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   11: std::panicking::try::do_call
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   12: __rust_try
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   13: std::panicking::try
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   14: std::panic::catch_unwind
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   15: <vision_utils_rs::frb_utils::MyExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/QAPMain/Development/frontend/vision_utils/rust/src/frb_utils.rs:29:37
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   16: <F as threadpool::FnBox>::call_box
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs:95:9
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   17: threadpool::spawn_in_pool::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./Users/tom/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs:769:17
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   18: std::sys_common::backtrace::__rust_begin_short_backtrace
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:125:18
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   19: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs:476:17
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   20: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:347:9
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   21: std::panicking::try::do_call
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   22: __rust_try
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   23: std::panicking::try
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   24: std::panic::catch_unwind
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   25: std::thread::Builder::spawn_unchecked::{{closure}}
2021-10-14 14:09:25.095 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/mod.rs:475:30
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   26: core::ops::function::FnOnce::call_once{{vtable.shim}}
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   27: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:       <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1572:9
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:       std::sys::unix::thread::Thread::new::thread_start
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:              at ./rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs:74:17
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   28: _ZL15__pthread_startPv
2021-10-14 14:09:25.096 5510-5598/com.rzzsdxx.vision_utils_example I/flutter:   29: __start_thread, null) s
@fzyzcjy fzyzcjy changed the title Frames of my crate disappears completely... Frames of my crate disappears completely for some of my code Oct 14, 2021
@fzyzcjy fzyzcjy changed the title Frames of my crate disappears completely for some of my code Frames of my crate disappears completely for some of the code; extreme case: add some useless code to function, then frames disappear Oct 14, 2021
@s1341
Copy link

s1341 commented Oct 14, 2021

I don't understand what you are doing... You backtrace before you call silly_function, no?

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

@s1341 Sure! That is the strange thing. silly_function should NOT affect my backtrace printing. But it indeed does!

I want to say, even doing such a seemingly unrelated thing, can cause frames to disappear.

Thanks for the reply!

@s1341
Copy link

s1341 commented Oct 14, 2021

silly_function is going to cause a stack overflow (or an i32 overflow, not sure which will come first) which will cause a panic which will dump a backtrace. That backtrace is not going to be using your code though... It's the standard panic backtrace. No?

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

Ah? It does not cause any stack overflows imho. I use rand so indeed it terminates after several times of recursion. (btw I write that simply because I want to do something that will not be optimized away by compiler)

@s1341
Copy link

s1341 commented Oct 14, 2021

I don't know then. I get backtraces when just using Backtrace::new even on release builds on aarch64 android 11.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

I am on armv7 (32bit). But rust should support this imho.

I get backtraces when just using Backtrace::new even on release builds on aarch64 android 11.

Have your app released to the market - i.e. I wonder whether it is ok on one phone, or ok on various kinds of phones (various version, etc)?

@s1341
Copy link

s1341 commented Oct 14, 2021

I'm not writing an app. I'm mostly running tools via shell (adb). I get backtraces on a few different phones.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

Ah... Thanks

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

A self-contained example that you can run

repo: https://github.com/fzyzcjy/flutter_rust_bridge/blob/experiment-backtrace/frb_example/with_flutter/README.md
(note: it is of this commit fzyzcjy/flutter_rust_bridge@8ec9751 , if you wonder)

Please ignore those readme and other unrelated code in that example. The only useful code is only dozens of lines.

Run it on android: https://github.com/fzyzcjy/flutter_rust_bridge/blob/experiment-backtrace/frb_example/with_flutter/run_android.sh

Brief introduction to the useful code there

  • rust/api.rs::off_topic_debug_throw sets up log and env variable (just some normal things), then call off_topic_code::print_backtrace_wrapper
  • print_backtrace_wrapper calls print_backtrace (both in off_topic_code.rs)
  • print_backtrace calls backtrace::trace and logs it.

However, looking at the code below, the print_backtrace function itself is completely disappeared.

I know this minimal reproducible sample is not as special ("add lines of code and frames disappear"), but I cannot reproduce that on this repo (can only reproduce "frames disappear").

2021-10-14 15:22:14.747 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc30f23c, symbol_address: 0xbc30f23c }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: backtrace::backtrace::trace::hbf362ad1261129c1 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc3114e6, symbol_address: 0xbc3114e6 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: flutter_rust_bridge_example::off_topic_code::print_backtrace_wrapper::h9e526c29536ceb08 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc30e2ac, symbol_address: 0xbc30e2ac }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: flutter_rust_bridge_example::api::off_topic_debug_throw::h1fb94bdca6682eac }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc3106a0, symbol_address: 0xbc3106a0 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h1cd83f04d1daa218 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc32618a, symbol_address: 0xbc32618a }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <flutter_rust_bridge::executor::DefaultExecutor as flutter_rust_bridge::executor::Executor>::execute::{{closure}}::{{closure}}::{{closure}}::hfdfef231a590a6d6 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc325a9a, symbol_address: 0xbc325a9a }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <F as threadpool::FnBox>::call_box::hda875d3b5ec17dee }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc32b4f0, symbol_address: 0xbc32b4f0 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys_common::backtrace::__rust_begin_short_backtrace::h2e5af7d5bdba07b5 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc32c990, symbol_address: 0xbc32c990 }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: core::ops::function::FnOnce::call_once{{vtable.shim}}::h2231d2ec5075a65b }
2021-10-14 15:22:14.756 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xbc357094, symbol_address: 0xbc357094 }
2021-10-14 15:22:14.778 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h38ec0cb28a956262, addr: 0x54093, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 15:22:14.778 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h217f23e1a784a072, addr: 0x54093, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs", lineno: 1572 }
2021-10-14 15:22:14.778 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: std::sys::unix::thread::Thread::new::thread_start::h50b9a01d25980cc1, addr: 0x54093, filename: "/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys/unix/thread.rs", lineno: 74 }
2021-10-14 15:22:14.778 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xedb0de34, symbol_address: 0xedb0de34 }
2021-10-14 15:22:14.779 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "_ZL15__pthread_startPv" }
2021-10-14 15:22:14.780 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace frame=Frame { ip: 0xedac70a4, symbol_address: 0xedac70a4 }
2021-10-14 15:22:14.780 11285-11357/? I/flutter_rust_bridge_e..: inside-api-debug_throw-b-hello:capture_and_print_backtrace resolve_frame symbol=Symbol { name: "__start_thread" }

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 14, 2021

All right... I guess it is problem of inline. Adding #[inline(never)] seems to solve the problem. Not sure, need more checks. Wait a bit.

@workingjubilee
Copy link
Contributor

Hm. Isn't "inlining can trash your backtraces" a known problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants