Skip to content

Commit f278c7a

Browse files
committed
MDEV-37502 mroonga + clang + Debug with exceeds stack frame size
Stack limits exceeded for clang-20 +Debug + MSAN. Added disables for the following functions. storage/mroonga/vendor/groonga/lib/ii.c:303:1: error: stack frame size (16696) exceeds limit (16384) in 'buffer_segment_reserve' [-Werror,-Wframe-larger-than] 303 | buffer_segment_reserve(grn_ctx *ctx, grn_ii *ii, | ^ storage/mroonga/vendor/groonga/lib/ii.c:4803:1: error: stack frame size (20936) exceeds limit (16384) in 'grn_ii_delete_one' [-Werror,-Wframe-larger-than] 4803 | grn_ii_delete_one(grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_ii_updspec *u, grn_hash *h) | ^ storage/mroonga/vendor/groonga/lib/ii.c:6313:1: error: stack frame size (25736) exceeds limit (16384) in 'grn_ii_column_update' [-Werror,-Wframe-larger-than] 6313 | grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section, | ^ For non-Debug the following stack frame sizes wher exceeded: storage/mroonga/vendor/groonga/lib/proc/proc_select.c:3575:1: warning: stack frame size (94072) exceeds limit (49152) in 'command_select' [-Wframe-larger-than] 3575 | command_select(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) | ^ storage/mroonga/vendor/groonga/lib/proc/proc_schema.c:1134:1: warning: stack frame size (98360) exceeds limit (49152) in 'command_schema_output_tables' [-Wframe-larger-than] 1134 | command_schema_output_tables(grn_ctx *ctx, grn_schema_data *data) Reviewer: Jimmy Hu <jimmy.hu@mariadb.com>
1 parent 8ce0eee commit f278c7a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

storage/mroonga/vendor/groonga/lib/ii.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ buffer_segment_new(grn_ctx *ctx, grn_ii *ii, uint32_t *segno)
300300
}
301301
}
302302

303+
PRAGMA_DISABLE_CHECK_STACK_FRAME
304+
303305
static grn_rc
304306
buffer_segment_reserve(grn_ctx *ctx, grn_ii *ii,
305307
uint32_t *lseg0, uint32_t *pseg0,
@@ -386,6 +388,8 @@ buffer_segment_reserve(grn_ctx *ctx, grn_ii *ii,
386388
return ctx->rc;
387389
}
388390

391+
PRAGMA_REENABLE_CHECK_STACK_FRAME
392+
389393
#define BGQENQUE(lseg) do {\
390394
if (ii->header->binfo[lseg] != GRN_II_PSEG_NOT_ASSIGNED) {\
391395
ii->header->bgqbody[ii->header->bgqhead] = ii->header->binfo[lseg];\
@@ -4529,8 +4533,6 @@ grn_ii_get_disk_usage(grn_ctx *ctx, grn_ii *ii)
45294533
}
45304534

45314535

4532-
PRAGMA_DISABLE_CHECK_STACK_FRAME
4533-
45344536
#define BIT11_01(x) ((x >> 1) & 0x7ff)
45354537
#define BIT31_12(x) (x >> 12)
45364538

@@ -4808,7 +4810,6 @@ exit :
48084810
return ctx->rc;
48094811
}
48104812

4811-
PRAGMA_REENABLE_CHECK_STACK_FRAME
48124813

48134814
grn_rc
48144815
grn_ii_delete_one(grn_ctx *ctx, grn_ii *ii, grn_id tid, grn_ii_updspec *u, grn_hash *h)

storage/mroonga/vendor/groonga/lib/proc/proc_schema.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,8 @@ command_schema_output_table(grn_ctx *ctx,
11301130
grn_ctx_output_map_close(ctx);
11311131
}
11321132

1133+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1134+
11331135
static void
11341136
command_schema_output_tables(grn_ctx *ctx, grn_schema_data *data)
11351137
{
@@ -1201,6 +1203,8 @@ command_schema_output_tables(grn_ctx *ctx, grn_schema_data *data)
12011203
GRN_OBJ_FIN(ctx, &table_ids);
12021204
}
12031205

1206+
PRAGMA_REENABLE_CHECK_STACK_FRAME
1207+
12041208
static grn_obj *
12051209
command_schema(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
12061210
{

storage/mroonga/vendor/groonga/lib/proc/proc_select.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3569,7 +3569,6 @@ grn_select_data_fill_drilldowns(grn_ctx *ctx,
35693569
return succeeded;
35703570
}
35713571
}
3572-
PRAGMA_REENABLE_CHECK_STACK_FRAME
35733572

35743573
static grn_obj *
35753574
command_select(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
@@ -3723,6 +3722,8 @@ exit :
37233722
return NULL;
37243723
}
37253724

3725+
PRAGMA_REENABLE_CHECK_STACK_FRAME
3726+
37263727
#define N_VARS 26
37273728
#define DEFINE_VARS grn_expr_var vars[N_VARS]
37283729

0 commit comments

Comments
 (0)