`<xmemory>`: Investigate ASan annotation for overaligned "big" allocations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
The implementation of std::allocator::allocate boosts the alignment of large allocations to help vectorization be more effective:
For allocations whose nominal alignment is at most __STDCPP_DEFAULT_NEW_ALIGNMENT__, we ask operator new for extra memory in order to perform the alignment manually:
It would be nice to enhance our ASan experience by poisoning the non-user space in these allocations to detect under/overflow. Doing so will probably require adding more symbols from sanitizer/asan_interface.h or sanitizer/common_interface.h to __msvc_sanitizer_annotate_container.hpp, as well as a new opt-out macro and detect_mismatch pragma.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked allocation paths in stl/inc/xmemory and the existing declarations in stl/inc/__msvc_sanitizer_annotate_container.hpp. Review the referenced sanitizer/asan_interface.h and sanitizer/common_interface.h APIs, then determine the symbols, opt-out macro, and detect_mismatch pragma needed to annotate the non-user space. Done means the ASan annotation approach and its required integration points are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100