[cfe-dev] Debug Info for Symbolification on Darwin using Address Sanitizer?
Jeffrey Walton
noloader at gmail.com
Wed Jul 31 17:06:21 PDT 2013
On Wed, Jul 31, 2013 at 9:49 AM, Alexander Potapenko <glider at google.com> wrote:
> Hi Jeffrey,
>
> You need to export the ASAN_SYMBOLIZER_PATH env var that'll point to
> the llvm-symbolizer binary (must reside in the same dir as Clang)
> Otherwise you can post-process the output using the
> compiler-rt/lib/asan/scripts/asan_symbolize.py script.
For completeness: http://llvm.org/bugs/show_bug.cgi?id=16767.
For others who stumble upon the thread, the docs that mention
asan_symbolize.py are at AddressSanitzer project page [0], and not
part of Clang's documentation.
Jeff
[0] http://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
> On Wed, Jul 31, 2013 at 2:21 AM, Jeffrey Walton <noloader at gmail.com> wrote:
>> Hi All,
>>
>> What additional switches should be added to get a good trace below? Or
>> do I need to post-process the output?
>>
>> Under gdb, I have symbols with -g3.
>>
>> $export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib/clang/3.3/lib/darwin/
>> $ ./testlib
>> ...
>>
>> crypt/sha2.c:342:37: runtime error: left shift of 128 by 24 places
>> cannot be represented in type 'int'
>> =================================================================
>> ==78966==ERROR: AddressSanitizer: global-buffer-overflow on address
>> 0x000102b71340 at pc 0x100bc4ce5 bp 0x7fff5f27de90 sp 0x7fff5f27de88
>> READ of size 1 at 0x000102b71340 thread T0
>> #0 0x100bc4ce4 (…/./testlib+0x10024cce4)
>> #1 0x10136caaf (…/./testlib+0x1009f4aaf)
>> #2 0x10132058f (…/./testlib+0x1009a858f)
>> #3 0x101329531 (…/./testlib+0x1009b1531)
>> #4 0x101319acc (…/./testlib+0x1009a1acc)
>> #5 0x10149a118 (…/./testlib+0x100b22118)
>> #6 0x101494e56 (…/./testlib+0x100b1ce56)
>> #7 0x101e6e8f7 (…/./testlib+0x1014f68f7)
>> #8 0x101d8d477 (…/./testlib+0x101415477)
>> #9 0x101d7e3a8 (…/./testlib+0x1014063a8)
>> #10 0x1020d9a7b (…/./testlib+0x101761a7b)
>> #11 0x1020d66cb (…/./testlib+0x10175e6cb)
>> #12 0x101eddb27 (…/./testlib+0x101565b27)
>> #13 0x101d8d477 (…/./testlib+0x101415477)
>> #14 0x101d7e3a8 (…/./testlib+0x1014063a8)
>> #15 0x101dbe7e8 (…/./testlib+0x1014467e8)
>> #16 0x101dbb6cf (…/./testlib+0x1014436cf)
>> #17 0x100aeee50 (…/./testlib+0x100176e50)
>> #18 0x100af6c56 (…/./testlib+0x10017ec56)
>> #19 0x7fff98b657e0 (/usr/lib/system/libdyld.dylib+0x27e0)
>> #20 0x0
>>
>> (The "…" were added for email formatting).
>>
>> Thanks in advance,
More information about the cfe-dev
mailing list