Skip to content

Instantly share code, notes, and snippets.

@eminence
Last active Mar 29, 2021
Embed
What would you like to do?
#[tokio::main]
async fn main() {
async {
process_many().await.unwrap();
}
.await;
}
async fn process_many() -> Result<(), Box<dyn std::error::Error>> {
process_one().await?;
Ok(())
}
async fn process_one() -> Result<(), Box<dyn std::error::Error>> {
panic!("something bad happened here");
}
thread 'main' panicked at 'something bad happened here', src\main.rs:16:5
stack backtrace:
0: 0x7ff6dcece93e - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
1: 0x7ff6dcece93e - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ff6dcece93e - std::sys_common::backtrace::_print_fmt
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\sys_common\backtrace.rs:67
3: 0x7ff6dcece93e - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\sys_common\backtrace.rs:46
4: 0x7ff6dcedcffc - core::fmt::write
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\core\src\fmt\mod.rs:1092
5: 0x7ff6dcecc9f8 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\io\mod.rs:1578
6: 0x7ff6dced1432 - std::sys_common::backtrace::_print
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\sys_common\backtrace.rs:49
7: 0x7ff6dced1432 - std::sys_common::backtrace::print
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\sys_common\backtrace.rs:36
8: 0x7ff6dced1432 - std::panicking::default_hook::{{closure}}
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panicking.rs:208
9: 0x7ff6dced0f0a - std::panicking::default_hook
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panicking.rs:225
10: 0x7ff6dced1a63 - std::panicking::rust_panic_with_hook
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panicking.rs:591
11: 0x7ff6dcebd411 - std::panicking::begin_panic::{{closure}}<str>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:520
12: 0x7ff6dcebca0f - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys_common\backtrace.rs:141
13: 0x7ff6dcebd34f - std::panicking::begin_panic<str>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:519
14: 0x7ff6dce3444d - stacks_rs::process_one::{{closure}}
at C:\Users\achin\tmp\21\stacks\stacks-rs\src\main.rs:16
15: 0x7ff6dce33bf1 - core::future::from_generator::{{impl}}::poll<generator-0>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\future\mod.rs:80
16: 0x7ff6dce34257 - stacks_rs::process_many::{{closure}}
at C:\Users\achin\tmp\21\stacks\stacks-rs\src\main.rs:10
17: 0x7ff6dce33df1 - core::future::from_generator::{{impl}}::poll<generator-0>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\future\mod.rs:80
18: 0x7ff6dce3454a - stacks_rs::main::{{closure}}::{{closure}}
at C:\Users\achin\tmp\21\stacks\stacks-rs\src\main.rs:4
19: 0x7ff6dce33d39 - core::future::from_generator::{{impl}}::poll<generator-0>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\future\mod.rs:80
20: 0x7ff6dce3470a - stacks_rs::main::{{closure}}
at C:\Users\achin\tmp\21\stacks\stacks-rs\src\main.rs:3
21: 0x7ff6dce33ca9 - core::future::from_generator::{{impl}}::poll<generator-0>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\future\mod.rs:80
22: 0x7ff6dce31f40 - tokio::park::thread::{{impl}}::block_on::{{closure}}<core::future::from_generator::GenFuture<generator-0>>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\park\thread.rs:263
23: 0x7ff6dce353fb - tokio::coop::with_budget::{{closure}}<core::task::poll::Poll<tuple<>>,closure-0>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\coop.rs:106
24: 0x7ff6dce31380 - std::thread::local::LocalKey<core::cell::Cell<tokio::coop::Budget>>::try_with<core::cell::Cell<tokio::coop::Budget>,closure-0,core::task::poll::Poll<tuple<>>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:272
25: 0x7ff6dce3102d - std::thread::local::LocalKey<core::cell::Cell<tokio::coop::Budget>>::with<core::cell::Cell<tokio::coop::Budget>,closure-0,core::task::poll::Poll<tuple<>>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:248
26: 0x7ff6dce31a35 - tokio::coop::with_budget
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\coop.rs:99
27: 0x7ff6dce31a35 - tokio::coop::budget
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\coop.rs:76
28: 0x7ff6dce31a35 - tokio::park::thread::CachedParkThread::block_on<core::future::from_generator::GenFuture<generator-0>>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\park\thread.rs:263
29: 0x7ff6dce322e4 - tokio::runtime::enter::Enter::block_on<core::future::from_generator::GenFuture<generator-0>>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\runtime\enter.rs:151
30: 0x7ff6dce33f16 - tokio::runtime::thread_pool::ThreadPool::block_on<core::future::from_generator::GenFuture<generator-0>>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\runtime\thread_pool\mod.rs:71
31: 0x7ff6dce31814 - tokio::runtime::Runtime::block_on<core::future::from_generator::GenFuture<generator-0>>
at C:\Users\achin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.3.0\src\runtime\mod.rs:452
32: 0x7ff6dce340a0 - stacks_rs::main
at C:\Users\achin\tmp\21\stacks\stacks-rs\src\main.rs:1
33: 0x7ff6dce34acb - core::ops::function::FnOnce::call_once<fn(),tuple<>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
34: 0x7ff6dce3416b - std::sys_common::backtrace::__rust_begin_short_backtrace<fn(),tuple<>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys_common\backtrace.rs:125
35: 0x7ff6dce35a31 - std::rt::lang_start::{{closure}}<tuple<>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:66
36: 0x7ff6dced1c07 - core::ops::function::impls::{{impl}}::call_once
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\library\core\src\ops\function.rs:280
37: 0x7ff6dced1c07 - std::panicking::try::do_call
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panicking.rs:379
38: 0x7ff6dced1c07 - std::panicking::try
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panicking.rs:343
39: 0x7ff6dced1c07 - std::panic::catch_unwind
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\panic.rs:431
40: 0x7ff6dced1c07 - std::rt::lang_start_internal
at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597\/library\std\src\rt.rs:51
41: 0x7ff6dce35a0f - std::rt::lang_start<tuple<>>
at C:\Users\achin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:65
42: 0x7ff6dce34146 - main
43: 0x7ff6dcee16e4 - invoke_main
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
44: 0x7ff6dcee16e4 - __scrt_common_main_seh
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
45: 0x7ffb2e9c7c24 - BaseThreadInitThunk
46: 0x7ffb2ecad721 - RtlUserThreadStart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment