Skip to content

Commit f65dda6

Browse files
committed
Fixed that one can compile MariaDB with ASAN with -Wframe-larger-than=16384
Added PRAGMA_DISABLE_CHECK_STACK_FRAME around some functions
1 parent 0ec675c commit f65dda6

File tree

13 files changed

+77
-2
lines changed

13 files changed

+77
-2
lines changed

client/mysqltest.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#endif
5656
#include <signal.h>
5757
#include <my_stacktrace.h>
58+
#include <my_attribute.h>
5859

5960
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
6061

@@ -78,7 +79,7 @@ static my_bool non_blocking_api_enabled= 0;
7879
#define MAX_DELIMITER_LENGTH 16
7980
#define DEFAULT_MAX_CONN 64
8081

81-
#define DIE_BUFF_SIZE 15*1024
82+
#define DIE_BUFF_SIZE 64*1024
8283

8384
#define RESULT_STRING_INIT_MEM 2048
8485
#define RESULT_STRING_INCREMENT_MEM 2048
@@ -1619,6 +1620,8 @@ static void make_error_message(char *buf, size_t len, const char *fmt, va_list a
16191620
s+= my_snprintf(s, end -s, "\n");
16201621
}
16211622

1623+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1624+
16221625
static void die(const char *fmt, ...)
16231626
{
16241627
char buff[DIE_BUFF_SIZE];
@@ -1630,6 +1633,8 @@ static void die(const char *fmt, ...)
16301633
really_die(buff);
16311634
}
16321635

1636+
PRAGMA_REENABLE_CHECK_STACK_FRAME
1637+
16331638
static void really_die(const char *msg)
16341639
{
16351640
static int dying= 0;
@@ -1658,6 +1663,8 @@ static void really_die(const char *msg)
16581663
cleanup_and_exit(1, 1);
16591664
}
16601665

1666+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1667+
16611668
void report_or_die(const char *fmt, ...)
16621669
{
16631670
va_list args;
@@ -1712,6 +1719,7 @@ void abort_not_supported_test(const char *fmt, ...)
17121719
cleanup_and_exit(62, 0);
17131720
}
17141721

1722+
PRAGMA_REENABLE_CHECK_STACK_FRAME
17151723

17161724
void abort_not_in_this_version()
17171725
{

mysys/mf_keycache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,6 +3903,8 @@ static int flush_cached_blocks(SIMPLE_KEY_CACHE_CB *keycache,
39033903
1 error
39043904
*/
39053905

3906+
PRAGMA_DISABLE_CHECK_STACK_FRAME
3907+
39063908
static int flush_key_blocks_int(SIMPLE_KEY_CACHE_CB *keycache,
39073909
File file, enum flush_type type)
39083910
{
@@ -4335,6 +4337,7 @@ static int flush_key_blocks_int(SIMPLE_KEY_CACHE_CB *keycache,
43354337
DBUG_RETURN(last_errno != 0);
43364338
}
43374339

4340+
PRAGMA_REENABLE_CHECK_STACK_FRAME
43384341

43394342
/*
43404343
Flush all blocks for a file from key buffers of a simple key cache

sql/sql_table.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10414,6 +10414,8 @@ static uint64 get_start_alter_id(THD *thd)
1041410414
based on information about the table changes from fill_alter_inplace_info().
1041510415
*/
1041610416

10417+
PRAGMA_DISABLE_CHECK_STACK_FRAME
10418+
1041710419
bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
1041810420
const LEX_CSTRING *new_name,
1041910421
Table_specification_st *create_info,
@@ -12028,6 +12030,7 @@ do_continue:;
1202812030
goto err_cleanup;
1202912031
}
1203012032

12033+
PRAGMA_REENABLE_CHECK_STACK_FRAME
1203112034

1203212035

1203312036
/**

sql/sys_vars.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
*/
8181
#define export /* not static */
8282

83+
PRAGMA_DISABLE_CHECK_STACK_FRAME
84+
8385
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
8486

8587
static Sys_var_mybool Sys_pfs_enabled(

storage/innobase/handler/i_s.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ static const LEX_CSTRING isolation_level_values[] =
280280

281281
static TypelibBuffer<4> isolation_level_values_typelib(isolation_level_values);
282282

283+
PRAGMA_DISABLE_CHECK_STACK_FRAME
284+
283285
namespace Show {
284286

285287
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */

storage/innobase/log/log0sync.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ group_commit_lock::lock_return_code group_commit_lock::acquire(value_type num, c
278278
return lock_return_code::EXPIRED;
279279
}
280280

281+
PRAGMA_DISABLE_CHECK_STACK_FRAME
282+
283+
281284
group_commit_lock::value_type group_commit_lock::release(value_type num)
282285
{
283286
completion_callback callbacks[950]; // 1000 fails with framesize 16384
@@ -395,6 +398,8 @@ group_commit_lock::value_type group_commit_lock::release(value_type num)
395398
return ret;
396399
}
397400

401+
PRAGMA_REENABLE_CHECK_STACK_FRAME
402+
398403
#ifndef DBUG_OFF
399404
bool group_commit_lock::is_owner()
400405
{

storage/innobase/page/page0page.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,8 @@ page_simple_validate_new(
20002000
return(ret);
20012001
}
20022002

2003+
PRAGMA_DISABLE_CHECK_STACK_FRAME
2004+
20032005
/** Check the consistency of an index page.
20042006
@param[in] page index page
20052007
@param[in] index B-tree or R-tree index
@@ -2436,6 +2438,8 @@ bool page_validate(const page_t* page, const dict_index_t* index)
24362438
return(ret);
24372439
}
24382440

2441+
PRAGMA_REENABLE_CHECK_STACK_FRAME
2442+
24392443
/***************************************************************//**
24402444
Looks in the page record list for a record with the given heap number.
24412445
@return record, NULL if not found */

storage/innobase/row/row0import.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4617,6 +4617,8 @@ dberr_t innodb_insert_hidden_fts_col(dict_table_t* table,
46174617
"END;\n", trx);
46184618
}
46194619

4620+
PRAGMA_DISABLE_CHECK_STACK_FRAME
4621+
46204622
/*****************************************************************//**
46214623
Imports a tablespace. The space id in the .ibd file must match the space id
46224624
of the table in the data dictionary.
@@ -4985,3 +4987,5 @@ row_import_for_mysql(
49854987

49864988
return row_import_cleanup(prebuilt, err, table);
49874989
}
4990+
4991+
PRAGMA_REENABLE_CHECK_STACK_FRAME

storage/innobase/srv/srv0start.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,8 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_undo,
859859
return DB_SUCCESS;
860860
}
861861

862+
PRAGMA_DISABLE_CHECK_STACK_FRAME
863+
862864
/** Open the configured number of dedicated undo tablespaces.
863865
@param[in] create_new_undo whether the undo tablespaces has to be created
864866
@param[in,out] mtr mini-transaction
@@ -920,6 +922,9 @@ dberr_t srv_undo_tablespaces_init(bool create_new_undo, mtr_t *mtr)
920922
return err;
921923
}
922924

925+
PRAGMA_REENABLE_CHECK_STACK_FRAME
926+
927+
923928
/** Create the temporary file tablespace.
924929
@param[in] create_new_db whether we are creating a new database
925930
@return DB_SUCCESS or error code. */
@@ -1158,6 +1163,8 @@ inline lsn_t log_t::init_lsn() noexcept
11581163
return lsn;
11591164
}
11601165

1166+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1167+
11611168
/** Start InnoDB.
11621169
@param[in] create_new_db whether to create a new database
11631170
@return DB_SUCCESS or error code */
@@ -1923,6 +1930,8 @@ dberr_t srv_start(bool create_new_db)
19231930
return(DB_SUCCESS);
19241931
}
19251932

1933+
PRAGMA_REENABLE_CHECK_STACK_FRAME
1934+
19261935
/**
19271936
Shutdown purge to make sure that there is no possibility that we call any
19281937
plugin code (e.g., audit) inside virtual column computation.

storage/maria/ma_loghandler.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,6 +3601,8 @@ static my_bool translog_is_LSN_chunk(uchar type)
36013601
@retval 1 Error
36023602
*/
36033603

3604+
PRAGMA_DISABLE_CHECK_STACK_FRAME
3605+
36043606
my_bool translog_init_with_table(const char *directory,
36053607
uint32 log_file_max_size,
36063608
uint32 server_version,
@@ -4234,6 +4236,7 @@ my_bool translog_init_with_table(const char *directory,
42344236
DBUG_RETURN(1);
42354237
}
42364238

4239+
PRAGMA_REENABLE_CHECK_STACK_FRAME
42374240

42384241
/*
42394242
@brief Free transaction log file buffer.

0 commit comments

Comments
 (0)