From b8ad202da1336550e6987a9c673d1a23e4b26e7b Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Tue, 3 Dec 2024 13:49:43 +0300 Subject: [PATCH] MDEV-34770 UBSAN: runtime error: load of address 0x... with insufficient space for an object of type 'uchar' in sys_vars.inl Disable UBSAN for global_var_ptr()/session_var_ptr() (none of "undefined" suboptions for gcc-13 worked). --- sql/set_var.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/set_var.h b/sql/set_var.h index c8da3c1c169..416993e5c34 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -247,9 +247,11 @@ protected: Typically it's the same as session_value_ptr(), but it's different, for example, for ENUM, that is printed as a string, but stored as a number. */ + __attribute__((no_sanitize("undefined"))) uchar *session_var_ptr(THD *thd) const { return ((uchar*)&(thd->variables)) + offset; } + __attribute__((no_sanitize("undefined"))) uchar *global_var_ptr() const { return ((uchar*)&global_system_variables) + offset; }