mirror of
https://github.com/MariaDB/server.git
synced 2026-04-18 06:15:32 +02:00
Check and remove high stack usage
I checked all stack overflow potential problems found with gcc -Wstack-usage=16384 and clang -Wframe-larger-than=16384 -no-inline Fixes: Added '#pragma clang diagnostic ignored "-Wframe-larger-than="' to a lot of function to where stack usage large but resonable. - Added stack check warnings to BUILD scrips when using clang and debug. Function changed to use malloc instead allocating things on stack: - read_bootstrap_query() now allocates line_buffer (20000 bytes) with malloc() instead of using stack. This has a small performance impact but this is not releant for bootstrap. - mroonga grn_select() used 65856 bytes on stack. Changed it to use malloc(). - Wsrep_schema::replay_transaction() and Wsrep_schema::recover_sr_transactions(). - Connect zipOpen3() Not fixed: - mroonga/vendor/groonga/lib/expr.c grn_proc_call() uses 43712 byte on stack. However this is not easy to fix as the stack used is caused by a lot of code generated by defines. - Most changes in mroonga/groonga where only adding of pragmas to disable stack warnings. - rocksdb/options/options_helper.cc uses 20288 of stack space. (no reason to fix except to get rid of the compiler warning) - Causes using alloca() where the allocation size is resonable. - An issue in libmariadb (reported to connectors).
This commit is contained in:
parent
07faba08b9
commit
0ccdf54b64
32 changed files with 293 additions and 106 deletions
|
|
@ -267,6 +267,12 @@ if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if test `$CC -v 2>&1 | head -1 | sed 's/ .*$//'` = 'clang' ; then
|
||||
dbug_cflags="$dbug_cflags -Wframe-larger-than=16384 -fno-inline"
|
||||
c_warnings="$c_warnings -Wframe-larger-than=16384"
|
||||
cxx_warnings="$cxx_warnings -Wframe-larger-than=16384"
|
||||
fi
|
||||
|
||||
|
||||
# If ccache (a compiler cache which reduces build time)
|
||||
# (http://samba.org/ccache) is installed, use it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue