Print more than one backtrace on error

Đang mở
#5 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
devtools

Hướng nghiên cứu

The payload names only the cga.toml whitelist format and the diagnostic text it produces, which lists 'backtrace (1 of N)' with one entry point and one trace. Start by reproducing the lint on the rsop repository with cargo cga check and reading the cga repository's handling of the whitelist entries and the note output. Done means the maintainers agree on how many backtraces to show and in what form, and a single run reports them. The thread has no decision yet, so settle the design with the maintainer before writing code.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Currently when I run cargo cga check on https://codeberg.org/heiko/rsop, I get an error which shows me a single entry point (main function) and a single backtrace starting from it:

error: call to function `sop::cli::main` which can panic
 --> rsop/src/bin/rsop.rs:6:5
  |
6 |     sop::cli::main(&mut rpgpie_sop::RPGSOP::default(), sop::cli::Variant::Full);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: 12 different panics from this location
  = note: backtrace (1 of 300953334964):
          0: core::panicking::panic (called)
          1: std::sys::sync::once::futex::Once::call (called)
          2: std::sync::Once::call_once_force::<{closure@std::sync::OnceLock<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::initialize<{closure@std::sync::OnceLock<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::get_or_init<{closure@std::io::stdin::{closure#0}}>::{closure#0}}, !>::{closure#0}}> (called)
          3: std::sync::OnceLock::<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::initialize::<{closure@std::sync::OnceLock<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::get_or_init<{closure@std::io::stdin::{closure#0}}>::{closure#0}}, !> (called)
          4: std::sync::OnceLock::<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::get_or_try_init::<{closure@std::sync::OnceLock<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::get_or_init<{closure@std::io::stdin::{closure#0}}>::{closure#0}}, !> (called)
          5: std::sync::OnceLock::<std::sync::Mutex<std::io::BufReader<std::io::stdio::StdinRaw>>>::get_or_init::<{closure@std::io::stdin::{closure#0}}> (called)
          6: std::io::stdin (called)
          7: sop::cli::real_main::<'_, rpgpie_sop::RPGSOP, rpgpie_sop::Certs, rpgpie_sop::Keys, rpgpie_sop::Sigs> (called)
          8: sop::cli::main::<'_, rpgpie_sop::RPGSOP, rpgpie_sop::Certs, rpgpie_sop::Keys, rpgpie_sop::Sigs> (called) <--
          9: rsop::main (entrypoint)
  = note: `#[deny(cga::panics)]` on by default

warning: [email protected]: rsop: shell completions written to /home/user/src/rsop/./target/cga/debug/build/rsop/032fe99886f2720a/out
warning: [email protected]: rsop: man pages written to /home/user/src/rsop/./target/cga/debug/build/rsop/032fe99886f2720a/out
error: could not compile `rsop` (bin "rsop") due to 1 previous error
Error: 101

In this case I want to add std::io::stdin to cga.toml whitelist and then rerun cargo cga check --config-path ./cga.toml. Then I get another backtrace, but each time the whole compilation is restarted so it will take me forever to collect all the functions that i trust.

Is there a way to get in a single run what all "12 different panics from this location" are or print more backtraces (definitely not all 300953334964 backtraces) at once?

My current cga.toml is this:

whitelist = [
  { crate = "core" },
  { crate = "env_logger" },
  { path = "^std::rt::panic_fmt" },
  { path = "^std::process::exit" },
  { path = "^sop::Password::new" },
  { path = "^std::io::stdout" },
  { path = "^std::io::stdin" }
]
Ngôn ngữ chính
Rust
Star
50
Fork
4
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenDevicePartnership/cga

Tất cả issue của OpenDevicePartnership/cga

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.