Fix/workaround for OS X truncated stacktraces taken by external tools
authorKuba Brecka <kuba.brecka@gmail.com>
Thu, 22 Jan 2015 23:36:47 +0000 (23:36 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Thu, 22 Jan 2015 23:36:47 +0000 (23:36 +0000)
commit405de4ae106cc989f81eafa262a0f324f2732a84
tree7a6ca5086c9c23dbb07a41ca1e1f89c8f2775bd9
parent495523e4ea3a4619b4f3e49419dbd45060a3c7fb
Fix/workaround for OS X truncated stacktraces taken by external tools

This patch is a proposed solution for https://code.google.com/p/address-sanitizer/issues/detail?id=375:

When the stacktraces are captured and printed by ASan itself, they are fine, but when the program has already printed the report (or is just printing it), capturing a stacktrace via other means is broken. "Other means" include OS X CrashReporter, debuggers or calling backtrace() within the program. For example calling backtrace() from a sanitizer_set_death_callback function prints a very truncated stacktrace.

Reviewed at http://reviews.llvm.org/D7103

llvm-svn: 226878
compiler-rt/lib/asan/asan_mac.cc
compiler-rt/lib/asan/asan_report.cc
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/test/asan/TestCases/Darwin/crashlog-stacktraces.c [new file with mode: 0644]