[PATCH] D20913: [asan] add primitives that allow coroutine implementations

Philippe Daouadi via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 06:58:55 PDT 2016


blastrock added a comment.

In http://reviews.llvm.org/D20913#462104, @dvyukov wrote:

> > One consequence is that the fake frame that should be allocated when entering the fiber is not, only the functions called from there have one.
>
>
> That's a consequence of manual annotations. If a program uses swapcontext, and we intercept and annotate it, then it won't happen, right?


Correct. But it's not that bad anyway I think. If the fake stack is there to find use-after-return errors, when the fiber entry function returns, it means the fiber is dead, so there is no real need to track those anymore. It's like a thread dying, and in both cases (thread or fiber) the fake stack is destroyed and it won't detect use-after-returns as such.

> I think it is fine. The guideline for manual annotations should then recommend to introduce an additional function that merely finishes the switch and calls real non-inlinable fiber body. Worth noting in __sanitizer_start_switch_fiber comment, and, yes, it needs some comment.


Yes, I was planning on writing a few lines of documentation when we all agree on the interface.

> I don't see any new test files. Did you forget to add a file?


I didn't add it. The test proposed by @filcab is based on printfs inside the asan library to show when fake frames are collected. We couldn't write an automatic test for that.


http://reviews.llvm.org/D20913





More information about the llvm-commits mailing list