Skip to content

configure hangs with --with-address-sanitizer on macOS (conftest spins in __asan::InitializeShadowMemory) #145199

@yukarikaname

Description

@yukarikaname

Bug report

Bug description:

When running ./configure --with-address-sanitizer on macOS, the configure step hangs at:

checking aligned memory access is required...

The generated conftest binary starts consuming ~90% CPU and never exits.

If I attach with lldb, the process appears to be spinning during AddressSanitizer initialization, with the stack showing:

__asan::InitializeShadowMemory
__asan::AsanInitInternal
wrap_malloc_default_zone
__malloc_init
libSystem_initializer
dyld4::prepare
...

It looks like this happens before main() is reached, so the hang seems to occur during ASAN runtime initialization (possibly during dyld/libSystem startup), rather than in cpython itself.

it can be reproduced after make distclean.

Environment:
macOS 26.3 (arm64)
xcode 26.2
Apple clang version 17.0.0 (clang-1700.6.3.2)

If this turns out to be a bug, I'd like to try working on it.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions