bytecodealliance / bytecodealliance/arf-strings
Error messages in ptr+length languages
- Vorherrschende Sprache
- C
- Sterne
- 16
- Forks
- 0
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
@alexcrichton pointed out that the error messages the current scheme will evoke will be unfortunate in ptr+length languages such as Rust in some cases where the Rust program has mutated the ARF string in an ARF-unaware way.
For an ARF translation like "hello\xffworld" => "\u{feff}hello�world\0hello\0\x7fworld", if Rust code appends a suffix such as ".txt", it'll produce "\u{feff}hello�world\0hello\0\x7fworld.txt". In this case, the embedded NUL will trigger ARF validation, and the validation will fail since the second half ends with ".txt" and the first half doesn't. A typical error message will include the name, which in this case will display as "hello�worldhelloworld.txt", which may confuse users.
Some brainstorming:
- Encode the entire second half in non-printing characters?
- Encode strings in the second half as something like base64 which would be printing but less likely to be mistaken for a corrupted string? We could get it to print as something like "hello�world-aGVsbG8gd29ybGQK.txt".
- Leave it as is?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne mit dem ARF-Übersetzungsbeispiel im Issue und untersuche, wie eine ptr+length-Mutation, etwa das Anhängen von .txt, Validierungsfehler und verwirrende angezeigte Namen verursacht. Vergleiche die drei vorgeschlagenen Ansätze für Fehlermeldungen und kläre das erwartete Verhalten vor der Implementierung; abgeschlossen bedeutet, dass das Projekt einen Ansatz für diese Validierungsfehler festgelegt hat.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, rust
- Bereich
- backend
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100