Make string-cache compatible with Strict Provenance
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza revisando la rama enlazada fix-aliasing y el informe de Strict Provenance; después inspecciona el uso de Atom en string-cache-codegen y el patrón generado que aparece en generated.rs:3381, al que se llega desde interface/tree_builder.rs:89. Se considera terminado cuando se conserve el nicho de Atom, se eviten los roundtrips de punteros y el patrón macro_rules! compile con las restricciones de provenance indicadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Rust
- Estrellas
- 212
- Forks
- 84
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 6
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de servo/string-cache
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
servo/string-cache#293 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
servo/string-cache#240 · 4 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
servo/string-cache#236 · 8 comentarios ·
-
Use a faster hash function Abiertoperformance
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
servo/string-cache#31 · 2 comentarios ·
Todos los issues de servo/string-cache
Issues similares
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Abiertobug CLI custom-model
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
Missing examples for `Allocator` AbiertoA-allocators A-docs C-enhancement T-libs
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100