bytecodealliance / bytecodealliance/arf-strings

Error messages in ptr+length languages

Abierto
#3 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C
Estrellas
16
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

@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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza con el ejemplo de traducción de ARF en el issue y examina cómo una mutación de ptr+length, como añadir .txt, provoca errores de validación y nombres mostrados confusos. Compara los tres enfoques propuestos para los mensajes de error y aclara el comportamiento esperado antes de la implementación; se considerará terminado cuando el proyecto haya decidido un enfoque para estos errores de validación.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
c, rust
Área
backend
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.