-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddressSanitizer support #30
Comments
already contained in boost.context (boost-1.65 release) -> BOOST_USE_ASAN |
Awesome!!! |
I tried this, but noted that However, Boost.Coroutine includes Indeed, using Can I assume that to get AddressSanitizer support I need to switch to Boost.Coroutine2? Or did I miss something?
|
that's because the generated instrumented code needs more stack - the error should be vanish if you use a large stack (at least that was the case in my tests) |
Unfortunately, some fixes did not permission to merged into 1.65 (no permission because too late) - could you could check branch develop please? |
The only fix I saw is cbab418 (correct?), and I could reproduce the problem on branch develop as well. Here is a simple test case:
Compiled with
What happens is that ASan is not notified about the stack switch and therefore refuses to clean up the stack frame of
|
Yes, ASAN is only supported for ucontext (see continuation_ucontext.hpp) - that's because the assembler implementation (continuation_fcontext.hpp) does not use global pointers, so it has no way to store restore stack bottoms. |
Thanks for the confirmation. It looks like Boost.Coroutine is using some |
Boost.Coroutine is deprecated - so it will never benefit from new features. |
Address sanitation complains about restarts-without-killing-nethack right now, e.g.: Address 0x000104064610 is a wild pointer. SUMMARY: AddressSanitizer: stack-buffer-overflow (/Applications/Xcode_11.3.1_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1e1ff) in wrap_memmove ... { "access_size": 1010, "access_type": 1, "address": 4361470432, "description": "stack-buffer-underflow", "instrumentation_class": "AddressSanitizer", "pc": 4296404778, "stop_type": "fatal_error" } I'm not sure if this is a false positive or not. I could not get ASAN_UNPOISON_MEMORY_REGION to be more than a no-op, and __asan_start_switch_fiber (+ end) did not seem to help. This could just be expected for fcontext (see https://bugs.llvm.org/show_bug.cgi?id=27627), but given that "normal" restarts (after proper game ends) work, I'm not so sure. See also boostorg/coroutine#30.
Can we please add something like
<asan>on
(similar to<valgrind>on
) which informs AddressSanitizer of the stack changes? It is described here:google/sanitizers#189 (comment)
https://github.com/llvm-mirror/compiler-rt/blob/master/include/sanitizer/common_interface_defs.h#L166
The text was updated successfully, but these errors were encountered: