25
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rustの RUST_BACKTRACE=1 さっぱり分からん☆(^~^)バックトレースは無いのかだぜ☆(^~^)?

Posted at

エラーが出ても

thread 'main' panicked at 'にょろにょろ', src\position.rs:193:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

と、エラーが発生した行だけ返ってきて、どこをたどって そこに行ったのか分からん。
C#言語でも Javaでも トレース機能はあるのに。

注意: 実行するときに 'RUST_BACKTRACE=1' を付けろよな

と教えてくれてはいるものの、

cargo run RUST_BACKTRACE=1

RUST_BACKTRACE=1 cargo run

cargo RUST_BACKTRACE=1 run

まったくダメ。わたしの環境では Rust にバックトレースは付いていないのだろう。
スタックオーバーフローを読んでも分からん。
そう思って 1年半 ぐらい経った。

そして さっき適当にググって
How do I run 'cargo test' with RUST_BACKTRACE=1 on Windows?
出てきた記事のレスを打ち込んだ。

set RUST_BACKTRACE=1
cargo run --example main

thread 'main' panicked at 'にょろにょろ', src\position.rs:193:9
stack backtrace:
   0: std::sys::windows::backtrace::set_frames
             at /rustc/にょろにょろ\src/libstd\sys\windows\backtrace\mod.rs:104
   1: std::sys::windows::backtrace::set_frames
             at /rustc/にょろにょろ\src/libstd\sys\windows\backtrace\mod.rs:104
   2: std::sys_common::backtrace::_print
             at /rustc/にょろにょろ\src/libstd\sys_common\backtrace.rs:71
   3: std::sys_common::backtrace::_print
             at /rustc/にょろにょろ\src/libstd\sys_common\backtrace.rs:71
   4: std::panicking::default_hook::{{closure}}
             at /rustc/にょろにょろ\src/libstd\panicking.rs:211
   5: std::panicking::default_hook
             at /rustc/にょろにょろ\src/libstd\panicking.rs:227
   6: std::panicking::rust_panic_with_hook
             at /rustc/にょろにょろ\src/libstd\panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at /rustc/にょろにょろ\src/libstd\panicking.rs:391
   8: std::panicking::rust_begin_panic
             at /rustc/にょろにょろ\src/libstd\panicking.rs:326
   9: core::panicking::panic_fmt
             at /rustc/にょろにょろ\src/libcore\panicking.rs:77
  10: core::panicking::panic_bounds_check
             at /rustc/にょろにょろ\src/libcore\panicking.rs:59
  11: kifuwarabe_wcsc29_lib::position::Position::get_id_piece_by_address
             at .\src\position.rs:193
  12: kifuwarabe_wcsc29_lib::usi_conv::usi_converter::UsiConverter::convert_move
             at .\src\usi_conv\usi_converter.rs:39
  13: kifuwarabe_wcsc29_lib::main_loop
             at .\src\lib.rs:205
  14: main::main
             at .\examples\main.rs:6
  15: std::rt::lang_start::{{closure}}<()>
             at \libstd\rt.rs:74
  16: std::rt::lang_start_internal::{{closure}}
             at /rustc/にょろにょろ\src/libstd\rt.rs:59
  17: std::rt::lang_start_internal::{{closure}}
             at /rustc/にょろにょろ\src/libstd\rt.rs:59
  18: panic_unwind::__rust_maybe_catch_panic
             at /rustc/にょろにょろ\src/libpanic_unwind\lib.rs:103
  19: std::panicking::try
             at /rustc/にょろにょろ\src/libstd\panicking.rs:289
  20: std::panicking::try
             at /rustc/にょろにょろ\src/libstd\panicking.rs:289
  21: std::panicking::try
             at /rustc/にょろにょろ\src/libstd\panicking.rs:289
  22: std::rt::lang_start<()>
             at \libstd\rt.rs:74
  23: main
  24: invoke_main
             at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  25: invoke_main
             at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  26: BaseThreadInitThunk
  27: RtlUserThreadStart
error: process didn't exit successfully: `target\debug\examples\main.exe` (exit code: 101)

お前、環境変数だったのかだぜ☆(^~^)

25
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?