-
Notifications
You must be signed in to change notification settings - Fork 267
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
Implementing __sanitizer_start_switch_fiber and __sanitizer_finish_switch_fiber for uthread to enable address sanitizer #178
Comments
The uthread implement referenced seastar's thread and deleted the asan support at beginning. detail see: https://github.com/scylladb/seastar/blob/master/src/core/thread.cc#L42 |
hmmm, 我对这个不是很熟, |
为什么我们要自己实现一个 |
不是要实现一个,是要在我们的代码里使用 __sanitizer_start_switch_fiber 这个来提示 asan 当前处于有栈协程中。比较麻烦的地方是需要实现两个版本的代码,你看 https://github.com/scylladb/seastar/blob/master/src/core/thread.cc#L42 这里,Debug 和 Release 的代码是分成两份来实现的 |
hmm,用 |
我们是DEBUG才需要这个是吗,通过宏NDEBUG判断一下? |
是的,可以这样
不太确认能不能这样,最坏情况就是检测编译器是否是 clang 以及是否开 NDEBUG 这样。。 |
GNU8以上不是也支持ASan么 |
是的。主要是我们内部就不怎么用 GCC 编这些新特性了,然后主要关注 clang,当然有 GCC 相关的改进肯定也都不会拒绝 |
Search before asking
What happened + What you expected to happen
Currently, the address sanitizer can't support uthread well. See google/sanitizers#189 for details. So we disabled the address sanitizer for uthread now to make the CI passes stably.
The proper fix may be implement
__asan_enter_fiber
and__asan_exit_fiber
in uthread to tell the sanitizer this is a stackful coroutine.Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: