obmalloc debug info can produce invalidly encoded output
@vstinner y travaille déjà.
Depuis le 2/8/2022.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 36k
- Merge moyen
- 1 j 9 h
- PR mergées (30 j)
- 558
Description
obmalloc's debug mode (specifically _PyMem_DebugCheckAddress() and _PyObject_DebugDumpAddress()) can produce output that is invalid in the text encoding being used by the process. This is because it prints the api_id byte to stderr with fprintf() using the %c format, and the byte can be corrupted. Because of the nature of these checks (they try to prevent memory corruption) it is actually fairly likely that the byte is corrupted, which can mean the output can't then be easily handled by tooling that expects a specific encoding (like UTF-8).
It would probably make sense to check whether the value of the api_id is a printable ASCII character before trying to print it, and resort to printing the value with %x instead.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Évaluation
Cette issue n'a pas encore été évaluée.