[all-commits] [llvm/llvm-project] 66298e: tsan: fix another false positive related to open/c...

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Thu Mar 10 08:03:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66298e1c54fcf3f4643528c461f5cf376d27055b
      https://github.com/llvm/llvm-project/commit/66298e1c54fcf3f4643528c461f5cf376d27055b
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2022-03-10 (Thu, 10 Mar 2022)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_fd.cpp
    A compiler-rt/test/tsan/fd_close_norace3.cpp

  Log Message:
  -----------
  tsan: fix another false positive related to open/close

The false positive fixed by commit f831d6fc80
("tsan: fix false positive during fd close") still happens episodically
on the added more stressful test which does just open/close.

I don't have a coherent explanation as to what exactly happens
but the fix fixes the false positive on this test as well.
The issue may be related to lost writes during asynchronous MADV_DONTNEED.
I've debugged similar unexplainable false positive related to freed and
reused memory and at the time the only possible explanation I found is that
an asynchronous MADV_DONTNEED may lead to lost writes. That's why commit
302ec7b9bc ("tsan: add memory_limit_mb flag") added StopTheWorld around
the memory flush, but unfortunately the commit does not capture these findings.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D121363




More information about the All-commits mailing list