• David 'Digit' Turner's avatar
    libc: Add logcat error message for memory corruption · 7708a89c
    David 'Digit' Turner authored
    Our dlmalloc implementation currently calls abort() when it detects
    that the heap is corrupted, or that an invalid pointer is passed to
    one of its functions.
    
    The only way to detect this is because abort() will force-fully
    crash the current program with a magic fault address of '0xdeadbaad'.
    
    However, this is not really well documented, and a frequent topic
    on the android-ndk forum (among others).
    
    This change makes our dlmalloc code dump a simple message to the
    log just before the abort() call (and hence before the stack trace)
    to better help identify the problem.
    
    Change-Id: Iebf7eb7fe26463ecadfaca8f247d237edb441e3c
    7708a89c
dlmalloc.c 189 KB