summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2006-09-27 14:42:56 -0400
committerunknown <cmiller@zippy.cornsilk.net>2006-09-27 14:42:56 -0400
commit7030bc95abe09331f5abd343e8b9544e7675c772 (patch)
tree71e70ee6239a3fcd2339ea532e0a8ae409272f6d /sql/mysql_priv.h
parent0d9242cefbb490cc24f84928ab8f8aa064f1a264 (diff)
downloadmariadb-git-7030bc95abe09331f5abd343e8b9544e7675c772.tar.gz
Bug#21476: (Thread stack overrun not caught, causing SEGV)
The STACK_MIN_SIZE is currently set to 8192, when we actually need (emperically discovered) 9236 bytes to raise an fatal error, on Ubuntu Dapper Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86. I'm taking that as a new lower bound, plus 100B of wiggle-room for sundry word sizes and stack behaviors. The added test verifies in a cross-platform way that there are no gaps between the space that we think we need and what we actually need to report an error. DOCUMENTERS: This also adds "let" to the mysqltest commands that evaluate an argument to expand variables therein. (Only right of the "=", of course.) client/mysqltest.c: Add "let" to the list of mysqltest commands that evaluates its arguments (only the right-hand-side of the equals-sign expression). mysql-test/r/mysqltest.result: Added test to show that mysqltest "let" will evaluate the RHS correctly (and expand the backslash test). mysql-test/t/mysqltest.test: Added test to show that mysqltest "let" will evaluate the RHS correctly (and expand the backslash test). sql/mysql_priv.h: Increase the amount we require to be available for the stack, since experience told us that the previous amount was too little by at least 1044 bytes. mysql-test/r/execution_constants.result: New BitKeeper file ``mysql-test/r/execution_constants.result'' mysql-test/t/execution_constants.test: New BitKeeper file ``mysql-test/t/execution_constants.test''
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index f293c769d75..5bf37d6b5f7 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -131,7 +131,18 @@ MY_LOCALE *my_locale_by_name(const char *name);
#define MAX_ACCEPT_RETRY 10 // Test accept this many times
#define MAX_FIELDS_BEFORE_HASH 32
#define USER_VARS_HASH_SIZE 16
-#define STACK_MIN_SIZE 8192 // Abort if less stack during eval.
+
+/*
+ Value of 9236 discovered through binary search 2006-09-26 on Ubuntu Dapper
+ Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86. (Added
+ 100 bytes as reasonable buffer against growth and other environments'
+ requirements.)
+
+ Feel free to raise this by the smallest amount you can to get the
+ "execution_constants" test to pass.
+ */
+#define STACK_MIN_SIZE 9336 // Abort if less stack during eval.
+
#define STACK_MIN_SIZE_FOR_OPEN 1024*80
#define STACK_BUFF_ALLOC 256 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT