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

Philippe Daouadi via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 10:11:46 PDT 2016


blastrock updated this revision to Diff 61205.
blastrock added a comment.

I think I got how fake stacks work. I implemented your idea @filcab, and with your test code, the FakeFrame is not collected anymore.

Now we must provide a void* to store the current FakeStack before a switch occurs. During a fiber switch, the FakeStack mechanism is disabled (I understand that it's ok to have __asan_stack_malloc() return null), I couldn't find a solution without disabling it. 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.

When leaving a fiber definitely, null must be passed as first argument so that instead of saving the fake stack, it gets destroyed.

I also removed the test I wrote which doesn't seem to test anything.


http://reviews.llvm.org/D20913

Files:
  include/sanitizer/common_interface_defs.h
  lib/asan/asan_thread.cc
  lib/asan/asan_thread.h
  test/asan/TestCases/Linux/swapcontext_annotation.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20913.61205.patch
Type: text/x-patch
Size: 13123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160619/2558c742/attachment.bin>


More information about the llvm-commits mailing list