1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34388: Stack overflow on Alpine Linux

page_is_corrupted(): Do not allocate the buffers from stack,
but from the heap, in xb_fil_cur_open().

row_quiesce_write_cfg(): Issue one type of message when we
fail to create the .cfg file.

update_statistics_for_table(), read_statistics_for_table(),
delete_statistics_for_table(), rename_table_in_stat_tables():
Use a common stack buffer for Index_stat, Column_stat, Table_stat.

ha_connect::FileExists(): Invoke push_warning_printf() so that
we can avoid allocating a buffer for snprintf().

translog_init_with_table(): Do not duplicate TRANSLOG_PAGE_SIZE_BUFF.

Let us also globally enable the GCC 4.4 and clang 3.0 option
-Wframe-larger-than=16384 to reduce the possibility of introducing
such stack overflow in the future.  For RocksDB and Mroonga we relax
these limits.

Reviewed by: Vladislav Lesin
This commit is contained in:
Marko Mäkelä
2025-05-20 17:27:05 +03:00
parent 2350295643
commit 82d7419e06
21 changed files with 130 additions and 119 deletions

View File

@@ -897,6 +897,9 @@ static int disable_binlog()
}
/* Ok as mysqlcheck is not multi threaded */
PRAGMA_DISABLE_CHECK_STACK_FRAME
static int handle_request_for_tables(char *tables, size_t length,
my_bool view, my_bool dont_quote)
{
@@ -1028,9 +1031,6 @@ static void insert_table_name(DYNAMIC_ARRAY *arr, char *in, size_t dblen)
insert_dynamic(arr, (uchar*) buf);
}
/* Ok as mysqlcheck is not multi threaded */
PRAGMA_DISABLE_CHECK_STACK_FRAME
static void __attribute__((noinline)) print_result()
{
MYSQL_RES *res;