<div dir="ltr"><div>there is no easy way for me or anyone else to do it -- the existing windows tests are not part of the llvm codebase, although I think they should.</div><div><a href="https://code.google.com/p/address-sanitizer/source/browse/trunk/win/tests">https://code.google.com/p/address-sanitizer/source/browse/trunk/win/tests</a><br>
</div><div style>Moreover, some of the tests are not at all windows-specific and would perfectly work on linux & mac.</div><div style>I think it's now a good time to start moving these tests into LLVM repo.</div><div style>
Those that are windows-specific, should go to compiler-rt/lib/asan/lit_tests/Windows. </div><div style>I would prefer if you can avoid using the common.h header -- just make the tests self-contained. </div><div style>Also, looking at llvm/tools/clang/test/*/*cpp, I see that the tests do not have any license header,<br>
</div><div style>so asan tests shouldn't have it either. </div><div style><br></div><div style>--kcc </div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 26, 2013 at 2:41 AM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please mind the expectations of Windows tests too.<br>
<br>
2013/3/22 Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Author: kcc<br>
> Date: Fri Mar 22 05:36:24 2013<br>
> New Revision: 177723<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177723&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177723&view=rev</a><br>
> Log:<br>
> [asan] Change the way we report the alloca frame on stack-buff-overflow.<br>
><br>
> Before: the function name was stored by the compiler as a constant string<br>
> and the run-time was printing it.<br>
> Now: the PC is stored instead and the run-time prints the full symbolized frame.<br>
> This adds a couple of instructions into every function with non-empty stack frame,<br>
> but also reduces the binary size because we store less strings (I saw 2% size reduction).<br>
> This change bumps the asan ABI version to v3.<br>
><br>
> compiler-rt part, llvm part will follow.<br>
><br>
> Example of report (now):<br>
> ==31711==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa77cf1c5 at pc 0x41feb0 bp 0x7fffa77cefb0 sp 0x7fffa77cefa8<br>
> READ of size 1 at 0x7fffa77cf1c5 thread T0<br>
> #0 0x41feaf in Frame0(int, char*, char*, char*) stack-oob-frames.cc:20<br>
> #1 0x41f7ff in Frame1(int, char*, char*) stack-oob-frames.cc:24<br>
> #2 0x41f477 in Frame2(int, char*) stack-oob-frames.cc:28<br>
> #3 0x41f194 in Frame3(int) stack-oob-frames.cc:32<br>
> #4 0x41eee0 in main stack-oob-frames.cc:38<br>
> #5 0x7f0c5566f76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)<br>
> #6 0x41eb1c (/usr/local/google/kcc/llvm_cmake/a.out+0x41eb1c)<br>
> Address 0x7fffa77cf1c5 is located in stack of thread T0 at offset 293 in frame<br>
> #0 0x41f87f in Frame0(int, char*, char*, char*) stack-oob-frames.cc:12 <<<<<<<<<<<<<< this is new<br>
> This frame has 6 object(s):<br>
> [32, 36) 'frame.addr'<br>
> [96, 104) 'a.addr'<br>
> [160, 168) 'b.addr'<br>
> [224, 232) 'c.addr'<br>
> [288, 292) 's'<br>
> [352, 360) 'd'<br>
><br>
><br>
><br>
> Added:<br>
> compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc<br>
> Modified:<br>
> compiler-rt/trunk/lib/asan/asan_interface_internal.h<br>
> compiler-rt/trunk/lib/asan/asan_report.cc<br>
> compiler-rt/trunk/lib/asan/asan_thread.cc<br>
> compiler-rt/trunk/lib/asan/asan_thread.h<br>
> compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc<br>
> compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc<br>
> compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc<br>
> compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc<br>
> compiler-rt/trunk/lib/asan/tests/asan_test.cc<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_interface_internal.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface_internal.h?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface_internal.h?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_interface_internal.h (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_interface_internal.h Fri Mar 22 05:36:24 2013<br>
> @@ -25,8 +25,13 @@ extern "C" {<br>
> // Everytime the asan ABI changes we also change the version number in this<br>
> // name. Objects build with incompatible asan ABI version<br>
> // will not link with run-time.<br>
> - void __asan_init_v2() SANITIZER_INTERFACE_ATTRIBUTE;<br>
> - #define __asan_init __asan_init_v2<br>
> + // Changes between ABI versions:<br>
> + // v1=>v2: added 'module_name' to __asan_global<br>
> + // v2=>v3: stack frame description (created by the compiler)<br>
> + // contains the function PC as the 3-rd field (see<br>
> + // DescribeAddressIfStack).<br>
> + void __asan_init_v3() SANITIZER_INTERFACE_ATTRIBUTE;<br>
> + #define __asan_init __asan_init_v3<br>
><br>
> // This structure describes an instrumented global variable.<br>
> struct __asan_global {<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_report.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_report.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_report.cc Fri Mar 22 05:36:24 2013<br>
> @@ -235,33 +235,61 @@ bool DescribeAddressIfShadow(uptr addr)<br>
> return false;<br>
> }<br>
><br>
> +// Return " (thread_name) " or an empty string if the name is empty.<br>
> +const char *ThreadNameWithParenthesis(AsanThreadContext *t, char buff[],<br>
> + uptr buff_len) {<br>
> + const char *name = t->name;<br>
> + if (name[0] == '\0') return "";<br>
> + buff[0] = 0;<br>
> + internal_strncat(buff, " (", 3);<br>
> + internal_strncat(buff, name, buff_len - 4);<br>
> + internal_strncat(buff, ")", 2);<br>
> + return buff;<br>
> +}<br>
> +<br>
> +const char *ThreadNameWithParenthesis(u32 tid, char buff[],<br>
> + uptr buff_len) {<br>
> + if (tid == kInvalidTid) return "";<br>
> + asanThreadRegistry().CheckLocked();<br>
> + AsanThreadContext *t = GetThreadContextByTidLocked(tid);<br>
> + return ThreadNameWithParenthesis(t, buff, buff_len);<br>
> +}<br>
> +<br>
> bool DescribeAddressIfStack(uptr addr, uptr access_size) {<br>
> AsanThread *t = FindThreadByStackAddress(addr);<br>
> if (!t) return false;<br>
> const sptr kBufSize = 4095;<br>
> char buf[kBufSize];<br>
> uptr offset = 0;<br>
> - const char *frame_descr = t->GetFrameNameByAddr(addr, &offset);<br>
> + uptr frame_pc = 0;<br>
> + char tname[128];<br>
> + const char *frame_descr = t->GetFrameNameByAddr(addr, &offset, &frame_pc);<br>
> // This string is created by the compiler and has the following form:<br>
> - // "FunctioName n alloc_1 alloc_2 ... alloc_n"<br>
> + // "n alloc_1 alloc_2 ... alloc_n"<br>
> // where alloc_i looks like "offset size len ObjectName ".<br>
> CHECK(frame_descr);<br>
> - // Report the function name and the offset.<br>
> - const char *name_end = internal_strchr(frame_descr, ' ');<br>
> - CHECK(name_end);<br>
> - buf[0] = 0;<br>
> - internal_strncat(buf, frame_descr,<br>
> - Min(kBufSize,<br>
> - static_cast<sptr>(name_end - frame_descr)));<br>
> Decorator d;<br>
> Printf("%s", d.Location());<br>
> - Printf("Address %p is located at offset %zu "<br>
> - "in frame <%s> of T%d's stack:\n",<br>
> - (void*)addr, offset, Demangle(buf), t->tid());<br>
> + Printf("Address %p is located in stack of thread T%d%s "<br>
> + "at offset %zu in frame\n",<br>
> + addr, t->tid(),<br>
> + ThreadNameWithParenthesis(t->tid(), tname, sizeof(tname)),<br>
> + offset);<br>
> + // Now we print the frame where the alloca has happened.<br>
> + // We print this frame as a stack trace with one element.<br>
> + // The symbolizer may print more than one frame if inlining was involved.<br>
> + // The frame numbers may be different than those in the stack trace printed<br>
> + // previously. That's unfortunate, but I have no better solution,<br>
> + // especially given that the alloca may be from entirely different place<br>
> + // (e.g. use-after-scope, or different thread's stack).<br>
> + StackTrace alloca_stack;<br>
> + alloca_stack.trace[0] = frame_pc + 16;<br>
> + alloca_stack.size = 1;<br>
> Printf("%s", d.EndLocation());<br>
> + PrintStack(&alloca_stack);<br>
> // Report the number of stack objects.<br>
> char *p;<br>
> - uptr n_objects = internal_simple_strtoll(name_end, &p, 10);<br>
> + uptr n_objects = internal_simple_strtoll(frame_descr, &p, 10);<br>
> CHECK(n_objects > 0);<br>
> Printf(" This frame has %zu object(s):\n", n_objects);<br>
> // Report all objects in this frame.<br>
> @@ -313,26 +341,6 @@ static void DescribeAccessToHeapChunk(As<br>
> Printf("%s", d.EndLocation());<br>
> }<br>
><br>
> -// Return " (thread_name) " or an empty string if the name is empty.<br>
> -const char *ThreadNameWithParenthesis(AsanThreadContext *t, char buff[],<br>
> - uptr buff_len) {<br>
> - const char *name = t->name;<br>
> - if (name[0] == '\0') return "";<br>
> - buff[0] = 0;<br>
> - internal_strncat(buff, " (", 3);<br>
> - internal_strncat(buff, name, buff_len - 4);<br>
> - internal_strncat(buff, ")", 2);<br>
> - return buff;<br>
> -}<br>
> -<br>
> -const char *ThreadNameWithParenthesis(u32 tid, char buff[],<br>
> - uptr buff_len) {<br>
> - if (tid == kInvalidTid) return "";<br>
> - asanThreadRegistry().CheckLocked();<br>
> - AsanThreadContext *t = GetThreadContextByTidLocked(tid);<br>
> - return ThreadNameWithParenthesis(t, buff, buff_len);<br>
> -}<br>
> -<br>
> void DescribeHeapAddress(uptr addr, uptr access_size) {<br>
> AsanChunkView chunk = FindHeapChunkByAddress(addr);<br>
> if (!chunk.IsValid()) return;<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_thread.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_thread.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_thread.cc Fri Mar 22 05:36:24 2013<br>
> @@ -151,7 +151,8 @@ void AsanThread::ClearShadowForThreadSta<br>
> PoisonShadow(stack_bottom_, stack_top_ - stack_bottom_, 0);<br>
> }<br>
><br>
> -const char *AsanThread::GetFrameNameByAddr(uptr addr, uptr *offset) {<br>
> +const char *AsanThread::GetFrameNameByAddr(uptr addr, uptr *offset,<br>
> + uptr *frame_pc) {<br>
> uptr bottom = 0;<br>
> if (AddrIsInStack(addr)) {<br>
> bottom = stack_bottom();<br>
> @@ -159,6 +160,7 @@ const char *AsanThread::GetFrameNameByAd<br>
> bottom = fake_stack().AddrIsInFakeStack(addr);<br>
> CHECK(bottom);<br>
> *offset = addr - bottom;<br>
> + *frame_pc = ((uptr*)bottom)[2];<br>
> return (const char *)((uptr*)bottom)[1];<br>
> }<br>
> uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1); // align addr.<br>
> @@ -183,6 +185,7 @@ const char *AsanThread::GetFrameNameByAd<br>
> uptr* ptr = (uptr*)SHADOW_TO_MEM((uptr)(shadow_ptr + 1));<br>
> CHECK(ptr[0] == kCurrentStackFrameMagic);<br>
> *offset = addr - (uptr)ptr;<br>
> + *frame_pc = ptr[2];<br>
> return (const char*)ptr[1];<br>
> }<br>
><br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_thread.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.h?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.h?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_thread.h (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_thread.h Fri Mar 22 05:36:24 2013<br>
> @@ -66,7 +66,7 @@ class AsanThread {<br>
> AsanThreadContext *context() { return context_; }<br>
> void set_context(AsanThreadContext *context) { context_ = context; }<br>
><br>
> - const char *GetFrameNameByAddr(uptr addr, uptr *offset);<br>
> + const char *GetFrameNameByAddr(uptr addr, uptr *offset, uptr *frame_pc);<br>
><br>
> bool AddrIsInStack(uptr addr) {<br>
> return addr >= stack_bottom_ && addr < stack_top_;<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/Linux/zero-base-shadow.cc Fri Mar 22 05:36:24 2013<br>
> @@ -18,7 +18,8 @@ int main(int argc, char **argv) {<br>
> int res = x[argc * 10]; // BOOOM<br>
> // CHECK: {{READ of size 1 at 0x.* thread T0}}<br>
> // CHECK: {{ #0 0x.* in _?main .*zero-base-shadow.cc:}}[[@LINE-2]]<br>
> - // CHECK: {{Address 0x.* is .* frame <main>}}<br>
> + // CHECK: {{Address 0x.* is .* frame}}<br>
> + // CHECK: main<br>
><br>
> // Check that shadow for stack memory occupies lower part of address space.<br>
> // CHECK-64: =>0x0f{{.*}}<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc Fri Mar 22 05:36:24 2013<br>
> @@ -1,7 +1,4 @@<br>
> -// Check that ASan is able to print demangled frame name even w/o<br>
> -// symbolization.<br>
> -<br>
> -// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s<br>
> +// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s<br>
><br>
> #include <string.h><br>
><br>
> @@ -11,9 +8,10 @@ struct YYY {<br>
> char array[10];<br>
> memset(array, 0, 10);<br>
> return array[x]; // BOOOM<br>
> - // CHECK: {{ERROR: AddressSanitizer: stack-buffer-overflow}}<br>
> - // CHECK: {{READ of size 1 at 0x.* thread T0}}<br>
> - // CHECK: {{Address 0x.* is .* frame <XXX::YYY::ZZZ(.*)>}}<br>
> + // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow<br>
> + // CHECK: READ of size 1 at<br>
> + // CHECK: is located in stack of thread T0 at offset<br>
> + // CHECK: XXX::YYY::ZZZ<br>
> }<br>
> };<br>
> } // namespace XXX<br>
><br>
> Added: compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc?rev=177723&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc?rev=177723&view=auto</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc (added)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc Fri Mar 22 05:36:24 2013<br>
> @@ -0,0 +1,59 @@<br>
> +// RUN: %clangxx_asan -m64 -O1 %s -o %t<br>
> +// RUN: %t 0 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK0<br>
> +// RUN: %t 1 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK1<br>
> +// RUN: %t 2 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK2<br>
> +// RUN: %t 3 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK3<br>
> +<br>
> +#define NOINLINE __attribute__((noinline))<br>
> +inline void break_optimization(void *arg) {<br>
> + __asm__ __volatile__("" : : "r" (arg) : "memory");<br>
> +}<br>
> +<br>
> +NOINLINE static void Frame0(int frame, char *a, char *b, char *c) {<br>
> + char s[4] = {0};<br>
> + char *d = s;<br>
> + break_optimization(&d);<br>
> + switch (frame) {<br>
> + case 3: a[5]++; break;<br>
> + case 2: b[5]++; break;<br>
> + case 1: c[5]++; break;<br>
> + case 0: d[5]++; break;<br>
> + }<br>
> +}<br>
> +NOINLINE static void Frame1(int frame, char *a, char *b) {<br>
> + char c[4] = {0}; Frame0(frame, a, b, c);<br>
> + break_optimization(0);<br>
> +}<br>
> +NOINLINE static void Frame2(int frame, char *a) {<br>
> + char b[4] = {0}; Frame1(frame, a, b);<br>
> + break_optimization(0);<br>
> +}<br>
> +NOINLINE static void Frame3(int frame) {<br>
> + char a[4] = {0}; Frame2(frame, a);<br>
> + break_optimization(0);<br>
> +}<br>
> +<br>
> +int main(int argc, char **argv) {<br>
> + if (argc != 2) return 1;<br>
> + Frame3(argv[1][0] - '0');<br>
> +}<br>
> +<br>
> +// CHECK0: AddressSanitizer: stack-buffer-overflow<br>
> +// CHECK0: #0{{.*}}Frame0<br>
> +// CHECK0: #1{{.*}}Frame1<br>
> +// CHECK0: #2{{.*}}Frame2<br>
> +// CHECK0: #3{{.*}}Frame3<br>
> +// CHECK0: is located in stack of thread T0 at offset<br>
> +// CHECK0-NEXT: #0{{.*}}Frame0<br>
> +//<br>
> +// CHECK1: AddressSanitizer: stack-buffer-overflow<br>
> +// CHECK1: is located in stack of thread T0 at offset<br>
> +// CHECK1-NEXT: #0{{.*}}Frame1<br>
> +//<br>
> +// CHECK2: AddressSanitizer: stack-buffer-overflow<br>
> +// CHECK2: is located in stack of thread T0 at offset<br>
> +// CHECK2-NEXT: #0{{.*}}Frame2<br>
> +//<br>
> +// CHECK3: AddressSanitizer: stack-buffer-overflow<br>
> +// CHECK3: is located in stack of thread T0 at offset<br>
> +// CHECK3-NEXT: #0{{.*}}Frame3<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc Fri Mar 22 05:36:24 2013<br>
> @@ -14,6 +14,7 @@ int main(int argc, char **argv) {<br>
> int res = x[argc * 10]; // BOOOM<br>
> // CHECK: {{READ of size 1 at 0x.* thread T0}}<br>
> // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]]<br>
> - // CHECK: {{Address 0x.* is .* frame <main>}}<br>
> + // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}}<br>
> + // CHECK: main<br>
> return res;<br>
> }<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc Fri Mar 22 05:36:24 2013<br>
> @@ -23,7 +23,8 @@ int main(int argc, char *argv[]) {<br>
> // CHECK: READ of size 4 at 0x{{.*}} thread T0<br>
> // CHECK: #0 0x{{.*}} in {{_?}}main<br>
> // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]]<br>
> - // CHECK: Address 0x{{.*}} is located at offset<br>
> - // CHECK: [[OFFSET:[^ ]*]] in frame <main> of T0{{.*}}:<br>
> + // CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset<br>
> + // CHECK: [[OFFSET:[^ ]*]] in frame<br>
> + // CHECK: main<br>
> // CHECK: {{\[}}[[OFFSET]], {{.*}}) 'x.i'<br>
> }<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=177723&r1=177722&r2=177723&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=177723&r1=177722&r2=177723&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Fri Mar 22 05:36:24 2013<br>
> @@ -465,6 +465,9 @@ TEST(AddressSanitizer, ManyStackObjectsT<br>
> EXPECT_DEATH(Ident(ZZZ)[-1] = 0, ASAN_PCRE_DOTALL "XXX.*YYY.*ZZZ");<br>
> }<br>
><br>
> +#if 0 // This test requires online symbolizer.<br>
> +// Moved to lit_tests/stack-oob-frames.cc.<br>
> +// Reenable here once we have online symbolizer by default.<br>
> NOINLINE static void Frame0(int frame, char *a, char *b, char *c) {<br>
> char d[4] = {0};<br>
> char *D = Ident(d);<br>
> @@ -500,6 +503,7 @@ TEST(AddressSanitizer, GuiltyStackFrame2<br>
> TEST(AddressSanitizer, GuiltyStackFrame3Test) {<br>
> EXPECT_DEATH(Frame3(3), "located .*in frame <.*Frame3");<br>
> }<br>
> +#endif<br>
><br>
> NOINLINE void LongJmpFunc1(jmp_buf buf) {<br>
> // create three red zones for these two stack objects.<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>