diff options
author | Elliott Hughes <enh@google.com> | 2013-06-12 14:05:46 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-06-12 14:14:53 -0700 |
commit | 61e699a133a4807fe878a6cb0d7190d7c96e21f8 (patch) | |
tree | 12dd46e7f8e5f7172a3fe0fd9075fa929cbb1001 /libc/private | |
parent | 5cde15eb17f4ddc0949c0cbd38a46e6c0bad7019 (diff) | |
download | bionic-61e699a133a4807fe878a6cb0d7190d7c96e21f8.zip bionic-61e699a133a4807fe878a6cb0d7190d7c96e21f8.tar.gz bionic-61e699a133a4807fe878a6cb0d7190d7c96e21f8.tar.bz2 |
Clean up abort.
* A dlmalloc usage error shouldn't call abort(3) because we want to
cause a SIGSEGV by writing the address dlmalloc didn't like to an
address the kernel won't like, so that debuggerd will dump the
memory around the address that upset dlmalloc.
* Switch to the simpler FreeBSD/NetBSD style of registering stdio
cleanup. Hopefully this will let us simplify more of the stdio
implementation.
* Clear the stdio cleanup handler before we abort because of a dlmalloc
corruption error. This fixes the reported bug, where we'd hang inside
dlmalloc because the stdio cleanup reentered dlmalloc.
Bug: 9301265
Change-Id: Ief31b389455d6876e5a68f0f5429567d37277dbc
Diffstat (limited to 'libc/private')
-rw-r--r-- | libc/private/libc_logging.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libc/private/libc_logging.h b/libc/private/libc_logging.h index e62ddf2..f69e2ed 100644 --- a/libc/private/libc_logging.h +++ b/libc/private/libc_logging.h @@ -79,6 +79,15 @@ __LIBC_HIDDEN__ __noreturn void __libc_fatal(const char* format, ...) __printflike(1, 2); // +// Formats a message to the log (priority 'fatal'), but doesn't abort. +// Used by the malloc implementation to ensure that debuggerd dumps memory +// around the bad address. +// + +__LIBC_HIDDEN__ void __libc_fatal_no_abort(const char* format, ...) + __printflike(1, 2); + +// // Formatting routines for the C library's internal debugging. // Unlike the usual alternatives, these don't allocate. // |