tst2005googlecode2 / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

No debug information on MacOS with gcc 4.8.1 #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using MacOS 10.7.5 and gcc 4.8.1, I compiled application with debug 
information and no optimizations: -O0 -g3 -fsanitize=address 
-fno-omit-frame-pointer. When running application I receive a correct error 
message (see output.txt) but without any debug information. It is probably 
because on mac debug information is stored separately, thus in case of valgrind 
one need to use dsymutil:
dsymutil <executable>
valgrind --dsymutil=yes
I could not find a similar option for AddressSanitizer.

Original issue reported on code.google.com by Lykov.Ki...@gmail.com on 17 Sep 2013 at 3:15

Attachments:

GoogleCodeExporter commented 9 years ago
Have you tried the asan_symbolize.py script or the ASAN_OPTIONS=symbolize=1 env 
var?

Original comment by gli...@chromium.org on 17 Sep 2013 at 3:17

GoogleCodeExporter commented 9 years ago
ASAN_OPTIONS=symbolize=1 is the default. It just wouldn't work w/o external 
symbolizer, and there is none in gcc. So, I think the only option for now is to 
use asan_symbolize.py script.

Original comment by samso...@google.com on 18 Sep 2013 at 9:10

GoogleCodeExporter commented 9 years ago
Please reopen if #2 doesn't help. 
Also please note, that gcc-asan on Mac is not something we actively support.
(gcc-asan on Linux is, and clang-asan on Mac&Linux even much so)

Original comment by konstant...@gmail.com on 3 Oct 2013 at 12:23

GoogleCodeExporter commented 9 years ago
On my gcc 4.8 or 4.9 on linux I cannot find asan_symbolize.py.
However, if and only if I set "ASAN_OPTIONS=symbolize=1" and "export 
ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4", then I get the symbolized 
report.

If I do "mybin 2>&1 | /usr/bin/asan_symbolize --demangle" (which is also from 
clang3.4), I can see the symbols, but without colours and missing some info

Original comment by dpi...@gmail.com on 31 Oct 2013 at 4:01

GoogleCodeExporter commented 9 years ago
> but without colours
asan_symbolize.py doesn't preserve the colors printed by ASan. Running "mybin 
2>&1 | cat" will have the same effect.

> and missing some info
Perhaps it's using addr2line instead of llvm-symbolizer, try to set 
LLVM_SYMBOLIZER_PATH.

Original comment by ramosian.glider@gmail.com on 31 Oct 2013 at 4:09

GoogleCodeExporter commented 9 years ago
I made asan_symbolize.py accept ASAN_SYMBOLIZER_PATH as well as 
LLVM_SYMBOLIZER_PATH in r193758.

Original comment by ramosian.glider@gmail.com on 31 Oct 2013 at 4:13