consider using/copying backtrace-ext to more properly filter the backtrace
还没有人认领这个 Issue。
评估
调研方向
从 src/report.rs 中 issue 链接的两个硬编码跳过 frame 的部分开始,然后将它们的行为与 backtrace_ext::short_frames_strict 进行比较。检查 issue 中描述的依赖项和 MSRV 影响;完成的标准是用提议的行为替换脆弱的过滤,并验证 panic 报告仍然显示预期的 stack。
由索引模型根据 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 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
rust-cli/human-panic#106 ·
-
难度 4/5 3-5 天 新手友好度 35/100
rust-cli/human-panic#54 · 11 条评论 · 19 个 reaction ·
-
enhancement
难度 5/5 一周以上 新手友好度 15/100
rust-cli/human-panic#46 · 8 条评论 ·
查看 rust-cli/human-panic 的全部 Issue
相似的 Issue
-
bug github_actions
难度 2/5 1-3 小时 新手友好度 75/100
registrystack/registry-stack#1393 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
难度 2/5 1-3 小时 新手友好度 65/100
rocky-data/rocky#2181 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
oasisprotocol/oasis-sdk#2523 ·
-
bot:ai-assisted component:indexer QA-roadmap status:untriaged
难度 2/5 1-3 小时 新手友好度 75/100
midnightntwrk/midnight-indexer#1557 ·