<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I see address sanitizer failures with TOT clang in readdir_r on Mac OS 10.9 like the following:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">=================================================================</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(195, 55, 32);"><b>==61104==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11617988 at pc 0x7fff36a bp 0xbffc2698 sp 0xbffc2684</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(83, 48, 225);"><b>WRITE of size 48830 at 0x11617988 thread T0</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> #0 0x7fff369 in wrap_readdir_r (/Users/jason/llvm/build/release/lib/clang/3.5/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x12369)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 189, 38);"><b>0x11617988 is located 0 bytes to the right of 520-byte region [0x11617780,0x11617988)</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);"><b>allocated by thread T0 here:</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> #0 0x800ab1f in wrap_malloc (/Users/jason/llvm/build/release/lib/clang/3.5/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x1db1f)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 wrap_readdir_r</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">==61104==ABORTING</div></div><div><br></div><div>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?</div><div><br></div><div>Jason</div><div><br></div><div></div></body></html>