tsan: always handle closing of file descriptors
If we miss both close of a file descriptor and a subsequent open if the same file descriptor number, we report false positives between operations on the old and on the new descriptors. There are lots of ways to create new file descriptors, but for closing there is mostly close call. So we try to handle at least it. However, if the close happens in an ignored library, we miss it and start reporting false positives. Handle closing of file descriptors always, even in ignored libraries (as we do for malloc/free and other critical functions). But don't imitate memory accesses on close for ignored libraries. FdClose checks validity of the fd (fd >= 0) itself, so remove the excessive checks in the callers. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D116095
Loading
Please sign in to comment