Hi, I’m debugging an issue with AddressSanitizer (ASan) on macOS.
I’ve noticed that strings placed in the __asan_cstring section are aligned and padded with redzones. When I attempt to copy a contiguous block of memory (e.g., memcpy(buf, asan_cstring, 4096)), ASan throws an out-of-bounds access error.
On the other hand, strings in the __cstring section do not cause this problem, likely because they are laid out contiguously without redzone padding.
Could you clarify:
Are strings in __asan_cstring section aligned and padded individually with redzones?
Is this redzone inserted after each global string for alignment or instrumentation purposes?
Does this mean that bulk memory copies over this section (even if read-only) are inherently unsafe under ASan?
Is there a recommended way to safely iterate or copy memory from __asan_cstring without triggering ASan violations?
Any guidance on how redzones are managed in the __asan_cstring section would be very helpful.