The configure script doesn't allow running ASan with PyMalloc
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 35.9k
- Métriques de merge des PR
- Métriques de PR en attente
Description
Bug report
Bug description:
The --with-address-sanitizer configure option overrides whatever pymalloc option one provides which it should not.
We should either allow it to work with --with-pymalloc, or, delete the line that disables pymalloc. I discussed it a bit during EP2025 sprint with @encukou .
This is done due to the line here:
https://github.com/python/cpython/blame/4a151cae3317ce133bdf0792fb1064c5030e588c/configure#L13352
I believe that CPython works fine with ASan + PyMalloc. I have tested it by removing the line above. Then the import _testcapi; _testcapi.WITH_PYMALLOC is True and there doesn't seem to be ASan crashes. However, there are leaks being detected, even when building Python, so I did all this with export ASAN_OPTIONS=detect_leaks=0.
It is also worth noting that we:
- List the
--without-pymallocflag in the devguide when showing how to run ASan. - We mention there, that the flag is not necessary, but it makes ASan more effective.
- We mention in CPython docs that it makes sense to disable PyMalloc when running ASan here
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
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.
Piste de recherche
Commencez par inspecter le script configure autour de la ligne 13352 ainsi que la gestion associée de --with-address-sanitizer et --with-pymalloc. Compilez CPython avec les deux options, vérifiez _testcapi.WITH_PYMALLOC et vérifiez le comportement ASan obtenu en tenant compte du paramètre detect_leaks documenté ainsi que du devguide et de la documentation mémoire liés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python, shell
- Domaine
- build-system
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100