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:
@@ -715,6 +715,10 @@ static void stop_timer(pool_timer_t *timer)
|
||||
|
||||
@return a ready connection, or NULL on shutdown
|
||||
*/
|
||||
|
||||
/* ev[MAX_EVENTS] may bloat the stack frame beyond 16 KiB */
|
||||
PRAGMA_DISABLE_CHECK_STACK_FRAME
|
||||
|
||||
static TP_connection_generic * listener(worker_thread_t *current_thread,
|
||||
thread_group_t *thread_group)
|
||||
{
|
||||
@@ -830,6 +834,7 @@ static TP_connection_generic * listener(worker_thread_t *current_thread,
|
||||
|
||||
DBUG_RETURN(retval);
|
||||
}
|
||||
PRAGMA_REENABLE_CHECK_STACK_FRAME
|
||||
|
||||
/**
|
||||
Adjust thread counters in group or global
|
||||
@@ -1157,6 +1162,9 @@ static bool too_many_threads(thread_group_t *thread_group)
|
||||
NULL is returned if timeout has expired,or on shutdown.
|
||||
*/
|
||||
|
||||
/* ev[MAX_EVENTS] may bloat the stack frame beyond 16 KiB */
|
||||
PRAGMA_DISABLE_CHECK_STACK_FRAME
|
||||
|
||||
TP_connection_generic *get_event(worker_thread_t *current_thread,
|
||||
thread_group_t *thread_group, struct timespec *abstime)
|
||||
{
|
||||
@@ -1262,6 +1270,7 @@ TP_connection_generic *get_event(worker_thread_t *current_thread,
|
||||
|
||||
DBUG_RETURN(connection);
|
||||
}
|
||||
PRAGMA_REENABLE_CHECK_STACK_FRAME
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user