[cfe-dev] Address sanitizer failures in readdir and statfs on Mac

Jason Haslam jason.haslam at gmail.com
Fri Feb 21 14:39:46 PST 2014


I see address sanitizer failures with TOT clang in readdir_r on Mac OS 10.9 like the following:

=================================================================
==61104==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11617988 at pc 0x7fff36a bp 0xbffc2698 sp 0xbffc2684
WRITE of size 48830 at 0x11617988 thread T0
    #0 0x7fff369 in wrap_readdir_r (/Users/jason/llvm/build/release/lib/clang/3.5/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x12369)
...
0x11617988 is located 0 bytes to the right of 520-byte region [0x11617780,0x11617988)
allocated by thread T0 here:
    #0 0x800ab1f in wrap_malloc (/Users/jason/llvm/build/release/lib/clang/3.5/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x1db1f)
...
SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 wrap_readdir_r
...
==61104==ABORTING

I get similar failures in statfs. Does anybody else see this? I got around these issues with the attached patch. Is there a better way to fix this without disabling these interceptors?

Jason

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140221/f1919fe4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asan-mavericks.diff
Type: application/octet-stream
Size: 1145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140221/f1919fe4/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140221/f1919fe4/attachment-0001.html>


More information about the cfe-dev mailing list