[LLVMbugs] [Bug 13174] address sanitizer is not working for attached simple program

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 22 08:13:30 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13174

Kostya Serebryany <kcc at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |kcc at google.com
         Resolution|                            |WONTFIX

--- Comment #2 from Kostya Serebryany <kcc at google.com> 2012-06-22 10:13:30 CDT ---
The test case is too simple -- it is optimized away by LLVM before asan gets a
chance to instrument it. 


% clang -S -o - -emit-llvm z.cc -w -O2 
; ModuleID = 'z.cc'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define i32 @main() nounwind uwtable readnone {
entry:
  ret i32 0
}

With -O0, the code does not get optimized away but asan still does not find the
overflow. 
This is also easy to explain: stack redzones are only 32-bytes and you have
overflow by 96x4 bytes. 

If you modify the test to contain arr[6] = 1;
and compile it with -O0, the bug will be detected.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list