• Paul Eggert's avatar
    Fix core dumps with gcc -fsanitize=address and GNU/Linux. · e76119d7
    Paul Eggert authored
    On my Fedora 19 platform the core dumps were so big that
    my desktop became nearly catatonic.
    * configure.ac: Check whether addresses are sanitized.
    (CANNOT_DUMP): Warn if addresses are sanitized and not CANNOT_DUMP.
    (DOUG_LEA_MALLOC): Do not define if addresses are sanitized.
    (SYSTEM_MALLOC): Define if addresses are sanitized.
    * src/alloc.c (no_sanitize_memcpy) [MAX_SAVE_STACK > 0]: New function.
    (Fgarbage_collect) [MAX_SAVE_STACK > 0]: Use it.
    (USE_ALIGNED_MALLOC): Do not define if addresses are sanitized.
    (mark_memory): Use ATTRIBUTE_NO_SANITIZE_ADDRESS rather than
    a clang-only syntax.
    * src/conf_post.h (__has_feature): New macro, if not already defined.
    (ADDRESS_SANITIZER, ADDRESS_SANITIZER_WORKAROUND)
    (ATTRIBUTE_NO_SANITIZE_ADDRESS): New macros.
    e76119d7
configure.ac 169 KB