commit 0eb8067bfe9ee4848df03469ccd1a8f9364df4a5
Author: Todd Lipcon <todd@cloudera.com>
Date: Wed Jul 10 15:34:15 2013 -0700
asan: handle SIGABRT On some kernel versions, if /proc/sys/vm/core_pattern is set to a pipe, then the setrlimit(RLIMIT_CORE) call to disable core dumps has no effect. In that case, if the user application calls abort(), then the uncaught SIGABRT triggers a core dump, resulting in a multi-TB pipe into the core dump handler (blocking the process for many hours). This patch adds a handler for SIGABRT which logs the error, then unmaps the shadow memory before propagating the signal. This allows a core dump to be processed reasonably even on 64-bit systems. Manually tested with an application which calls "abort()". On systems set up as described above, this used to hang for hours as it tried to send the large core dump through the pipe. With the patch, it outputs: $ ./coredump ASAN:SIGABRT ==28640==ERROR: AddressSanitizer: ABRT (pc 0x7f8632666425 sp 0x7fff0cae8f08 bp 0x7fff0cae91d0 T0) #0 0x7f8632666424 (/lib/x86_64-linux-gnu/libc-2.15.so+0x36424) #1 0x7f8632669b8a (/lib/x86_64-linux-gnu/libc-2.15.so+0x39b8a) #2 0x42b11e (/tmp/coredump+0x42b11e) #3 0x7f863265176c (/lib/x86_64-linux-gnu/libc-2.15.so+0x2176c) #4 0x42ae7c (/tmp/coredump+0x42ae7c) Aborted (core dumped)
Looks like you don't "invoke" default handler, you just install it here.