The configure script doesn't allow running ASan with PyMalloc
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra script configure quanh dòng 13352 và phần xử lý liên quan đến --with-address-sanitizer và --with-pymalloc. Build CPython với cả hai tùy chọn, kiểm tra _testcapi.WITH_PYMALLOC và xác minh hành vi ASan thu được, đồng thời lưu ý đến thiết lập detect_leaks đã được ghi chép và devguide cùng tài liệu về bộ nhớ được liên kết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python, shell
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100