mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-37781 ASAN build crashes on deep query with low thread stack
check_stack_overrun() was compiled out under ASAN, so a deeply nested expression recursed in Item_func::fix_fields() until the stack was exhausted and the server crashed instead of reporting ER_STACK_OVERRUN_NEED_MORE. Since MDEV-34533 (Monty) the stack usage seems to be accounted correctly under ASAN via my_get_stack_pointer(), so the check seems to works there too. Fix: Remove the #ifndef __SANITIZE_ADDRESS__ guard from check_stack_overrun() Add a test for ER_STACK_OVERRUN_NEED_MORE
This commit is contained in:
@@ -7636,7 +7636,6 @@ __attribute__((optimize("-O0")))
|
||||
#endif
|
||||
check_stack_overrun(THD *thd, long margin, uchar *buf __attribute__((unused)))
|
||||
{
|
||||
#ifndef __SANITIZE_ADDRESS__
|
||||
long stack_used;
|
||||
DBUG_ASSERT(thd == current_thd);
|
||||
DBUG_ASSERT(thd->thread_stack);
|
||||
@@ -7661,7 +7660,6 @@ check_stack_overrun(THD *thd, long margin, uchar *buf __attribute__((unused)))
|
||||
#ifndef DBUG_OFF
|
||||
max_stack_used= MY_MAX(max_stack_used, stack_used);
|
||||
#endif
|
||||
#endif /* __SANITIZE_ADDRESS__ */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user