1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-34099: AddressSanitizer running out of memory regardless of stack_thread size

Address Sanitizer's know how to detect stack overrun, so there's
no point in us doing it.

As evidenced by perfschema tests where signficant test failures
because this function failed under ASAN (MDEV-33210).

Also, so since clang-16, we cannot assume much about how local
variables are allocated on the stack (MDEV-31605).

Disabling check idea thanks to Sanja.
This commit is contained in:
Daniel Black
2024-07-05 14:26:13 +10:00
committed by Andrew Hutchings
parent 405613ebb5
commit cf1c381bb8

View File

@@ -7614,6 +7614,7 @@ __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);
if ((stack_used= available_stack_size(thd->thread_stack, &stack_used)) >=
@@ -7636,6 +7637,7 @@ 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;
}