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

Philippe Daouadi via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 12 12:08:21 PDT 2016


blastrock updated the summary for this revision.
blastrock updated this revision to Diff 60476.
blastrock added a comment.

I changed the interface to what @filcab suggested. Another downside is that getting the current thread's stack bounds is done through a non-portable pthread API, but it does simplify asan code.

I made my implementation more signal-proof by using volatile. I saw later that in some other parts of the code, you prefer using atomic access, I can change the volatiles to that if needed.

I split the tests and left the swapcontext test as it is currently. I also added a test that spams signals while it runs that @dvyukov asked for. As I said, the timer as a poor resolution on my machine, so it doesn't test anything more than the test without the signals.

I removed the stddef include and changed some logs to verbose reports. I changed my clang-format to google style and reformatted a few things I wrote.

About the FakeStack stuff, I wrote a new test, planning to do the void** thing @filcab asked for, but the test is already passing on my machine. Could you help me write a failing test before I implement that feature?


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
  test/asan/TestCases/Linux/swapcontext_use_after_return.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20913.60476.patch
Type: text/x-patch
Size: 17839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160612/9caafdcf/attachment.bin>


More information about the llvm-commits mailing list