ramosian-glider / sanitizers

0 stars 0 forks source link

On mac asan_symbolize script does not symbolicate frames coming from a dynamic library #93

Open ramosian-glider opened 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 92

By code inspection, asan does not attempt to symbolicate the frames coming from a dynamic
library:
    if filetype == "DYLIB":
      load_addr = "0x0"
    if DEBUG:
      print "atos -o %s -arch %s -l %s" % (binary, arch, load_addr)
    pipes[binary] = subprocess.Popen(["atos", "-o", binary, "-arch", arch, "-l", load_addr],
                         stdin=subprocess.PIPE, stdout=subprocess.PIPE,)

I also tested this out on a toy example; here the use-after-free happens in a dylib:

da0603a-dhcp178:bin zaks$ ./a.out 2>&1 | /Users/zaks/workspace/llvmgit/llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py=================================================================
==59636== ERROR: AddressSanitizer heap-use-after-free on address 0x0001067c4b80 at
pc 0x1062caf03 bp 0x7fff63e608b0 sp 0x7fff63e608a8
READ of size 4 at 0x0001067c4b80 thread T0
atos -o /Applications/Xcode.app/Contents/Developer/Toolchains/iOS6.0.xctoolchain/usr/bin/ex.dylib
-arch x86_64 -l 0x0
    #0 0x1062caf02 in 0x00000f03 (in ex.dylib)
atos -o /Applications/Xcode.app/Contents/Developer/Toolchains/iOS6.0.xctoolchain/usr/bin/./a.out
-arch x86_64 -l 0x104261000
got symbolicator for /Applications/Xcode.app/Contents/Developer/Toolchains/iOS6.0.xctoolchain/usr/bin/a.out,
base address 100000000
    #1 0x104262584 in start (in a.out) + 52
    #2 0x1

> What version of the product are you using? On what operating system?
TOT clang; Lion

Reported by zaks.anna on 2012-07-18 17:26:30

ramosian-glider commented 9 years ago

Reported by ramosian.glider on 2015-07-30 09:05:30

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:06:55