Skip to content

Commit f2ef683

Browse files
committed
MDEV-37705 main.lotofstack /main.sp-error fails in MSAN+Debug
Tests on clang-20/21 had both of these tests overrunning the stack. The check_stack_overrun function checked the function earlier with a 2*STACK_MIN_SIZE margin. The exection within the processing is deeper then when check_stack_overrun was called. Raising STACK_MIN_SIZE to 44k was sufficient (and 40k wasn't oufficient). execution_constants also tested however the topic mention tests are bigger. Perfscheam tests * perfschema.statement_program_nesting_event_check * perfschema.statement_program_nested * perfschema.max_program_zero A small increase to the test thread-stack-size on statement_program_lost_inst allows this test to continue to pass.
1 parent f9bdff6 commit f2ef683

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

mysql-test/suite/perfschema/t/max_program_zero.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
--source include/not_embedded.inc
1313
--source include/have_perfschema.inc
14+
--source include/not_msan_with_debug.inc
1415

1516
--source ../include/start_server_common.inc
1617

mysql-test/suite/perfschema/t/statement_program_lost_inst.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
2222
--write_line wait $restart_file
2323
--shutdown_server
2424
--source include/wait_until_disconnected.inc
25-
--write_line "restart:--performance_schema_max_program_instances=7 --performance_schema_max_statement_stack=2 --thread_stack=655360" $restart_file
25+
--write_line "restart:--performance_schema_max_program_instances=7 --performance_schema_max_statement_stack=2 --thread_stack=1048576" $restart_file
2626
--enable_reconnect
2727
--source include/wait_until_connected_again.inc
2828

mysql-test/suite/perfschema/t/statement_program_nested.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
--source include/not_embedded.inc
66
--source include/have_perfschema.inc
77
--source include/have_innodb.inc
8+
--source include/not_msan_with_debug.inc
89

910
TRUNCATE TABLE performance_schema.events_statements_summary_by_program;
1011
TRUNCATE TABLE performance_schema.events_statements_history_long;

mysql-test/suite/perfschema/t/statement_program_nesting_event_check.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
--source include/not_embedded.inc
99
--source include/have_perfschema.inc
1010
--source include/have_innodb.inc
11+
--source include/not_msan_with_debug.inc
1112

1213
TRUNCATE TABLE performance_schema.events_statements_history_long;
1314

sql/sql_const.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,14 @@
167167
Feel free to raise this by the smallest amount you can to get the
168168
"execution_constants" test to pass.
169169
*/
170+
#ifndef __has_feature
171+
#define __has_feature(x) 0
172+
#endif
173+
#if defined(__clang__) && __has_feature(memory_sanitizer) && !defined(DBUG_OFF)
174+
#define STACK_MIN_SIZE 44000
175+
#else
170176
#define STACK_MIN_SIZE 16000 // Abort if less stack during eval.
177+
#endif
171178

172179
#define STACK_MIN_SIZE_FOR_OPEN (1024*80)
173180
#define STACK_BUFF_ALLOC 352 ///< For stack overrun checks

0 commit comments

Comments
 (0)