[PATCH] D15080: [asan] Reports suppressions for ASan recovery mode (compiler-rt part).

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 12:58:15 PST 2015


kcc added a reviewer: dvyukov.
kcc added a comment.

In http://reviews.llvm.org/D15080#302479, @m.ostepenko wrote:

> Updating the diff.
>
> It seems we cannot get rid of races without using mutex,


Oh, sure we can. :)

?>  because we should protect access to different parts of AsanBuggyPcPool array. However, using a mutex here is undesirable due to performance issue. So, for now, I see such alternatives how to implement suppression:

> 

> 

> 1. Use mutex. This is probably an overkill.


Yep, no mutex please.

> 2. Use atomic pc_num counter and non-atomic accesses to AsanBuggyPcPool. Here, we would have races on accesses to AsanBuggyPcPool, that may lead to duplication in reports (e.g. when 2 threads with same PC are searching in AsanBuggyPcPool and no one hasn't updated the array yet). Also, we'll need to add one additional check for AsanBuggyPcPool overflow before updating the pool because it is possible that multiple threads would try to update it simultaneously.

> 

>   This patch implements the second approach for now, thought it's OK to have few duplications in favor of performance.


Summoning lock-free synchronization guru

> Konstantin, what do you think about it?



http://reviews.llvm.org/D15080





More information about the llvm-commits mailing list