This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 5e7ea5e305 [fix](memory) Fix `bthread_setspecific` log fatal on UBSAN build (#18274) 5e7ea5e305 is described below commit 5e7ea5e3051618b9ab1f14e41f54f0fc616a29dc Author: Xinyi Zou <zouxiny...@gmail.com> AuthorDate: Fri Mar 31 19:46:53 2023 +0800 [fix](memory) Fix `bthread_setspecific` log fatal on UBSAN build (#18274) --- be/src/runtime/thread_context.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/be/src/runtime/thread_context.h b/be/src/runtime/thread_context.h index 0d0896cc10..e4a707d2be 100644 --- a/be/src/runtime/thread_context.h +++ b/be/src/runtime/thread_context.h @@ -191,6 +191,11 @@ private: TUniqueId _fragment_instance_id; }; +#if defined(UNDEFINED_BEHAVIOR_SANITIZER) +static ThreadContext* thread_context() { + return thread_context_ptr._ptr; +} +#else // Cache the pointer of bthread local in pthead local, // Avoid calling bthread_getspecific frequently to get bthread local, which has performance problems. static void pthread_attach_bthread() { @@ -225,6 +230,7 @@ static ThreadContext* thread_context() { return thread_context_ptr._ptr; } } +#endif class ScopeMemCount { public: --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org