bytecodealliance / bytecodealliance/arf-strings
Error messages in ptr+length languages
- Lingua principale
- C
- Stelle
- 16
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
@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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia con l’esempio di traduzione ARF nell’issue ed esamina come una mutazione di ptr+length, ad esempio l’aggiunta di .txt, provochi errori di validazione e nomi visualizzati fuorvianti. Confronta i tre approcci proposti per i messaggi di errore e chiarisci il comportamento previsto prima dell’implementazione; il lavoro sarà considerato completato quando il progetto avrà deciso un approccio per questi errori di validazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, rust
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100