tsan: do not crash when user intercepts fopen()

llvm-svn: 191066
This commit is contained in:
Dmitry Vyukov 2013-09-20 02:01:38 +00:00
parent 3e9a6d345a
commit 20f6ff1e66
1 changed files with 4 additions and 0 deletions

View File

@ -1751,7 +1751,11 @@ TSAN_INTERCEPTOR(int, getaddrinfo, void *node, void *service,
// and can report false race between malloc and free
// inside of getaddrinfo. So ignore memory accesses.
ThreadIgnoreBegin(thr);
// getaddrinfo calls fopen, which can be intercepted by user.
thr->in_rtl--;
CHECK_EQ(thr->in_rtl, 0);
int res = REAL(getaddrinfo)(node, service, hints, rv);
thr->in_rtl++;
ThreadIgnoreEnd(thr);
return res;
}