[PATCH] D54889: Fiber support for thread sanitizer

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 05:36:57 PST 2018


dvyukov added a comment.

In D54889#1309507 <https://reviews.llvm.org/D54889#1309507>, @yuri wrote:

> In D54889#1309474 <https://reviews.llvm.org/D54889#1309474>, @dvyukov wrote:
>
> > It's unclear how this is supposed to be used. I would expect to see an interceptor for swapcontext that will make use of this, but there is none...
>
>
> Interceptor for swapcontext without additional sanitizer API is not enough because it is not known when context is created and destroyed. Actually, I am not sure if swapcontext is actually used by someone because it is slow and has strange limitations.
>
> My interface assumes is that users should call __tsan_switch_to_fiber() immediately before switching context and then call swapcontext or whatever he want to perform actual switch.


What do people use nowadays?

Will swapcontext work along with makecontext interceptor?
swapcontext is still used, and it's also a good way to show how the API should be used and to write tests.

>> If these annotations are supposed to be user callable (are they? why?), we also need interface declarations in:
>>  https://github.com/llvm-mirror/compiler-rt/blob/master/include/sanitizer/tsan_interface.h
> 
> Interface change is already present in diff.

Missed it.
But also comments. Perhaps I did not expect that interface declarations can take that few lines when scanned the change.

>> We also need tests (lots) that demonstrate how this can be used and that this works.
> 
> OK, I will work on it and add some tests.




Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54889/new/

https://reviews.llvm.org/D54889





More information about the llvm-commits mailing list