[compiler-rt] r176804 - [ASan] Reduce the local buffer size in Report() not to fail the check enforced when building TSan runtime.
Alexander Potapenko
glider at google.com
Mon Mar 11 06:36:39 PDT 2013
Author: glider
Date: Mon Mar 11 08:36:39 2013
New Revision: 176804
URL: http://llvm.org/viewvc/llvm-project?rev=176804&view=rev
Log:
[ASan] Reduce the local buffer size in Report() not to fail the check enforced when building TSan runtime.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc?rev=176804&r1=176803&r2=176804&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc Mon Mar 11 08:36:39 2013
@@ -201,8 +201,11 @@ int internal_snprintf(char *buffer, uptr
// Like Printf, but prints the current PID before the output string.
void Report(const char *format, ...) {
const int kLen = 16 * 1024;
- // |local_buffer| is small enough not to overflow the stack.
- char local_buffer[512];
+ // |local_buffer| is small enough not to overflow the stack and/or violate
+ // the stack limit enforced by TSan (-Wframe-larger-than=512). On the other
+ // hand, the bigger the buffer is, the more the chance the error report will
+ // fit into it.
+ char local_buffer[400];
int needed_length;
int pid = GetPid();
char *buffer = local_buffer;
More information about the llvm-commits
mailing list