Browse Source
Check and remove high stack usage
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).bb-10.6-MDEV-33896-galera
32 changed files with 293 additions and 106 deletions
-
6BUILD/SETUP.sh
-
7client/mysqlcheck.c
-
4client/mysqlslap.c
-
2client/mysqltest.cc
-
4extra/mariabackup/fil_cur.cc
-
14include/my_attribute.h
-
31sql/sql_bootstrap.cc
-
12sql/sql_statistics.cc
-
3sql/sql_yacc.yy
-
99sql/wsrep_schema.cc
-
18storage/archive/ha_archive.cc
-
9storage/connect/ha_connect.cc
-
6storage/connect/tabmul.cpp
-
52storage/connect/zip.c
-
5storage/innobase/row/row0quiesce.cc
-
4storage/maria/ma_loghandler.c
-
4storage/maria/ma_open.c
-
34storage/maria/ma_recovery.c
-
3storage/maria/unittest/ma_test_loghandler-t.c
-
1storage/mroonga/vendor/groonga/CMakeLists.txt
-
18storage/mroonga/vendor/groonga/lib/db.c
-
5storage/mroonga/vendor/groonga/lib/load.c
-
5storage/mroonga/vendor/groonga/lib/operator.c
-
4storage/mroonga/vendor/groonga/lib/proc/proc_object_list.c
-
9storage/mroonga/vendor/groonga/lib/proc/proc_schema.c
-
20storage/mroonga/vendor/groonga/lib/proc/proc_select.c
-
3storage/perfschema/unittest/pfs_instr-t.cc
-
4storage/spider/spd_db_conn.cc
-
2tests/async_queries.c
-
4tests/mysql_client_fw.c
-
4unittest/mysys/bitmap-t.c
-
3unittest/sql/mf_iocache-t.cc
Write
Preview
Loading…
Cancel
Save
Reference in new issue