[compiler-rt] r174184 - tsan: catch races on fd in more cases
David Blaikie
dblaikie at gmail.com
Fri Feb 1 08:05:57 PST 2013
On Feb 1, 2013 7:55 AM, "Dmitry Vyukov" <dvyukov at google.com> wrote:
>
> Author: dvyukov
> Date: Fri Feb 1 09:52:35 2013
> New Revision: 174184
>
> URL: http://llvm.org/viewvc/llvm-project?rev=174184&view=rev
> Log:
> tsan: catch races on fd in more cases
I haven't actually been looking at the *San changes in detail, but is this
sort of thing testable?
> Modified:
> compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
> URL:
http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=174184&r1=174183&r2=174184&view=diff
>
==============================================================================
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri Feb 1
09:52:35 2013
> @@ -595,6 +595,8 @@ TSAN_INTERCEPTOR(void*, mmap, void *addr
> return MAP_FAILED;
> void *res = REAL(mmap)(addr, sz, prot, flags, fd, off);
> if (res != MAP_FAILED) {
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> MemoryResetRange(thr, pc, (uptr)res, sz);
> }
> return res;
> @@ -607,6 +609,8 @@ TSAN_INTERCEPTOR(void*, mmap64, void *ad
> return MAP_FAILED;
> void *res = REAL(mmap64)(addr, sz, prot, flags, fd, off);
> if (res != MAP_FAILED) {
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> MemoryResetRange(thr, pc, (uptr)res, sz);
> }
> return res;
> @@ -1150,21 +1154,29 @@ TSAN_INTERCEPTOR(int, lstat64, const cha
>
> TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
> SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf);
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> return REAL(__fxstat)(version, fd, buf);
> }
>
> TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) {
> SCOPED_TSAN_INTERCEPTOR(__fxstat, 0, fd, buf);
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> return REAL(__fxstat)(0, fd, buf);
> }
>
> TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) {
> SCOPED_TSAN_INTERCEPTOR(__fxstat64, version, fd, buf);
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> return REAL(__fxstat64)(version, fd, buf);
> }
>
> TSAN_INTERCEPTOR(int, fstat64, int fd, void *buf) {
> SCOPED_TSAN_INTERCEPTOR(__fxstat64, 0, fd, buf);
> + if (fd > 0)
> + FdAccess(thr, pc, fd);
> return REAL(__fxstat64)(0, fd, buf);
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130201/841f515f/attachment.html>
More information about the llvm-commits
mailing list