<div dir="ltr">+samsonov@</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 2:46 PM, Richtarsky, Martin <span dir="ltr"><<a href="mailto:martin.richtarsky@sap.com" target="_blank">martin.richtarsky@sap.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I noticed that debugging of AddressSanitizer-instrumented debug binaries<br>
is basically impossible since all the symbols are optimized out. It looks like<br>
there is something wrong with debug info. I'm getting the same behavior<br>
on 3.4 and trunk. Interestingly it works for -fsanitize=undefined. Is this a known<br>
issue? There are several related bugs but they are fixed already, e.g.<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=11818" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=11818</a><br>
<br>
# cat UnitAsanStackOOB.cpp<br>
int main()<br>
{<br>
const int len = 10;<br>
char buffer[len];<br>
char *p = &buffer[0];<br>
p[len] = 1;<br>
return 0;<br>
}<br>
<br>
# clang++ -g -o oob_trunk_add -fsanitize=address UnitAsanStackOOB.cpp<br>
# gdb oob_trunk_add<br>
GNU gdb (GDB) 7.5.1<br>
Reading symbols from /local/build/git5/sys/src/clang/AddressSanitizer/test/oob_trunk_add...done.<br>
(gdb) b main<br>
Breakpoint 1 at 0x495a4a: file UnitAsanStackOOB.cpp, line 3.<br>
(gdb) run<br>
Starting program: /local/build/git5/sys/src/clang/AddressSanitizer/test/oob_trunk_add<br>
[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib64/libthread_db.so.1".<br>
Breakpoint 1, main () at UnitAsanStackOOB.cpp:3<br>
3 const int len = 10;<br>
(gdb) n<br>
5 char *p = &buffer[0];<br>
(gdb) n<br>
6 p[len] = 1;<br>
(gdb) p p<br>
$1 = <optimized out><br>
(gdb) p len<br>
$2 = <optimized out><br>
<br>
# clang++ -g -o oob_trunk_und -fsanitize=undefined UnitAsanStackOOB.cpp<br>
# gdb oob_trunk_und<br>
GNU gdb (GDB) 7.5.1<br>
(gdb) b main<br>
Breakpoint 1 at 0x426280: file UnitAsanStackOOB.cpp, line 2.<br>
(gdb) run<br>
Starting program: /local/build/git5/sys/src/clang/AddressSanitizer/test/oob_trunk_und<br>
[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib64/libthread_db.so.1".<br>
Breakpoint 1, main () at UnitAsanStackOOB.cpp:2<br>
2 {<br>
(gdb) n<br>
3 const int len = 10;<br>
(gdb) n<br>
5 char *p = &buffer[0];<br>
(gdb) n<br>
6 p[len] = 1;<br>
(gdb) p p<br>
$1 = 0x7fffffff975e ""<br>
(gdb) p len<br>
$2 = 10<br>
<br>
# clang++ -v<br>
clang version 3.5.0 (trunk 204863)<br>
Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br>
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.3<br>
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.3<br>
Candidate multilib: .;@m64<br>
Candidate multilib: 32;@m32<br>
Selected multilib: .;@m64<br>
<br>
Best regards,<br>
Martin<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>