consider using/copying backtrace-ext to more properly filter the backtrace
まだ誰も着手していません。
評価
調査の方向性
src/report.rs の、issue からリンクされているハードコードされたフレームスキップ処理の2つのセクションから始め、続いてその挙動を backtrace_ext::short_frames_strict と比較してください。issue に記載されている依存関係と MSRV への影響を確認してください。脆弱なフィルタリングを提案された挙動に置き換え、panic レポートに意図したスタックが引き続き表示されることを検証できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
human-panic currently skips a hardcoded number of frames which is... not what you want to do:
https://github.com/rust-cli/human-panic/blob/c0e52f47213eebfb3212f8029ff5705fd0e0c091/src/report.rs#L47-L52
https://github.com/rust-cli/human-panic/blob/c0e52f47213eebfb3212f8029ff5705fd0e0c091/src/report.rs#L66-L71
Rust emits two magic frame names to delimit the "runtime glue" from the "real stack". Unfortunately the backtrace crate doesn't support handling that for you. As such I made backtrace-ext::short_frames_strict to do that for everyone who is implementing this kind of logic.
The example is basically already human-panic's impl because I found this problem in miette which copied your impl. I can do the PR for you but I wasn't sure if you were ok with adding this dep (it's basically one complicated function but slightly factored out so I could unit test the crap out of it because you should never trust backtraces to provide decent input).
(NB: at the time of filing this issue I've published 0.2.0 but docs.rs is super backlogged. 0.2.0 includes fixes from me adding all the comprehensive tests, and also removes the "re-export of all of Backtrace" because I realized it's goody. If you see this issue soon enough just know that this line in the example changed to import Backtrace from backtrace and not backtrace-ext.)
(0.2.0 is live now, also I cut 0.2.1 to lower the msrv)
- 主要言語
- Rust
- スター
- 1.9k
- フォーク
- 65
- 平均マージ
- 2時間 48分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-cli/human-panic のほかの issue
-
breaking-change enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
rust-cli/human-panic#194 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-cli/human-panic#167 · コメント 2 件 ·
-
Dependency Dashboard オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
rust-cli/human-panic#106 ·
-
Custom error message オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-cli/human-panic#54 · コメント 11 件 · リアクション 19 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
rust-cli/human-panic#46 · コメント 8 件 ·
rust-cli/human-panic の issue をすべて見る
似ている issue
-
bug CLI custom-model
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
rust-bitcoin/rust-bitcoin#6930 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100