mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-39109 main.sp-error stack overflow debug, MSAN and ASAN
MSAN seems error on stack depth 39 so set limit to 20. ASAN error-ed on stack depth 248 so set limit to 200. The actua;ly depth wasn't important for the purposes of the fatal error handling in MySQL bug #15192 from which this test originates. Reviewed/Approved by: Oleksandr "Sanja" Byelkin (sanja@mariadb.com)
This commit is contained in:
@@ -1575,7 +1575,12 @@ declare continue handler for 0 set @x=0;
|
||||
end$$
|
||||
ERROR HY000: Incorrect CONDITION value: '0'
|
||||
set @old_recursion_depth = @@max_sp_recursion_depth;
|
||||
set @@max_sp_recursion_depth = 255;
|
||||
set @l = 255;
|
||||
SELECT IF(global_value like 'MSAN%', 20,
|
||||
IF(global_value LIKE 'ASAN%', 200, 255)) INTO @l
|
||||
FROM information_schema.system_variables
|
||||
WHERE variable_name='have_sanitizer' AND version() LIKE '%debug%';
|
||||
set @@max_sp_recursion_depth = @l;
|
||||
create procedure p1(a int)
|
||||
begin
|
||||
declare continue handler for 1436 -- ER_STACK_OVERRUN_NEED_MORE
|
||||
|
||||
@@ -2230,10 +2230,17 @@ delimiter ;$$
|
||||
|
||||
#
|
||||
# Bug#15192: "fatal errors" are caught by handlers in stored procedures
|
||||
#
|
||||
# MDEV-39109 - lower limits for debug sanitizers.
|
||||
|
||||
set @old_recursion_depth = @@max_sp_recursion_depth;
|
||||
set @@max_sp_recursion_depth = 255;
|
||||
set @l = 255;
|
||||
--disable_warnings
|
||||
SELECT IF(global_value like 'MSAN%', 20,
|
||||
IF(global_value LIKE 'ASAN%', 200, 255)) INTO @l
|
||||
FROM information_schema.system_variables
|
||||
WHERE variable_name='have_sanitizer' AND version() LIKE '%debug%';
|
||||
--enable_warnings
|
||||
set @@max_sp_recursion_depth = @l;
|
||||
delimiter |;
|
||||
create procedure p1(a int)
|
||||
begin
|
||||
|
||||
@@ -170,6 +170,12 @@
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
/*
|
||||
Note, rather than trying to micro adjust these every time
|
||||
slightly different test fails, potentially on slightly different
|
||||
compiler, look at adjusting the test. For example main.sp-error
|
||||
at Bug#15192.
|
||||
*/
|
||||
#if defined(__clang__) && __has_feature(memory_sanitizer) && !defined(DBUG_OFF)
|
||||
#define STACK_MIN_SIZE 44000
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user