Make string-cache compatible with Strict Provenance
まだ誰も着手していません。
評価
調査の方向性
まず、リンクされている fix-aliasing ブランチと Strict Provenance レポートを確認し、次に string-cache-codegen での Atom の使用箇所と、interface/tree_builder.rs:89 からたどれる generated.rs:3381 に示された生成パターンを調べます。完了条件は、Atom の niche を維持しながらポインタのラウンドトリップを避け、報告された provenance の制約下で macro_rules! パターンをコンパイルできることです。
索引モデルが issue の本文から書いたものです。
説明
Original title: Status of provenance/aliasing issues detected by Miri
Hi, I wish I were being helpful here but I'm just reporting the status of some hackery I've done. (hours wasted here, etc)
This is one of the most-downloaded crates that roundtrips pointer values through integers. I'm looking into most such crates to understand if it's possible to rewrite such roundtrips or if there's something better that can be done to support what libraries want to do.
For this crate, I do not think that it is possible to patch out the roundtrips, but the problem isn't the round-tripping. This crate wants to store pointers inside Atom, and to do that in a well-defined way we need a type which is capable of storing provenance and also plain old bytes, so we could use a raw pointer type or MaybeUninit. But we want to uphold the niche which it currently has, so the only type which is eligible is NonNull. But putting NonNull in that field breaks string-cache-codegen, because it puts Atom in a macro_rules! pattern:
error: to use a constant of type `std::ptr::NonNull` in a pattern, `std::ptr::NonNull` must be annotated with `#[derive(PartialEq, Eq)]`
--> /tmp/markup5ever-0.11.0/target/miri/x86_64-unknown-linux-gnu/debug/build/markup5ever-85445da718f099e3/out/generated.rs:3381:39
|
3381 | ...html") => { $ crate :: ATOM_NAMESPACE__68_74_74_70_3A_2F_2F_77_77_77_2E_77_33_2E_6F_72_67_2F_31_39_39_39_2F_78_68_74_6D_6C } ;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: interface/tree_builder.rs:89:9
|
89 | expanded_name!(html "template") => flags.template = true,
| ------------------------------- in this macro invocation
|
= note: this error originates in the macro `namespace_url` (in Nightly builds, run with -Z macro-backtrace for more info)
I've put up the changes that would remove the ptr-int-ptr roundtrips (as well as some aliasing issues with Box that current SB has) in a branch in case anyone is interested: https://github.com/servo/string-cache/compare/master...saethlin:fix-aliasing
- 主要言語
- Rust
- スター
- 212
- フォーク
- 84
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
servo/string-cache のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
servo/string-cache#293 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
servo/string-cache#240 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
servo/string-cache#236 · コメント 8 件 ·
-
performance
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
servo/string-cache#31 · コメント 2 件 ·
servo/string-cache の 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 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. オープンbot:ai-assisted component:indexer QA-roadmap status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
midnightntwrk/midnight-indexer#1557 ·