llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

tsan: false positives on shmat

Open KernelAddress opened this issue 7 years ago • 1 comments

Bugzilla Link 40282
Version unspecified
OS Linux

Extended Description

Reported internally, don't have a public repro. The crux: shmat/shmdt allocate/deallocate memory (like mmap/munmap). We don't do anything in shmat/shmdt interceptors, so if the memory becomes reused across shmat calls in different threads, tsan may report a false positive. Accesses to the new mapping of the memory "race" with accesses to the old mapping at the same address. We need shmat/shmdt interceptors to do the same as mmap/munmap interceptors. Probably the common code to "map" and "unmap" a range can be factored out.

KernelAddress avatar Jan 10 '19 10:01 KernelAddress

assigned to @vitalybuka

KernelAddress avatar Jan 10 '19 10:01 KernelAddress