Skip to content

Commit

Permalink
config: increase coro stack size if it is less than pagesize(fluent#3716
Browse files Browse the repository at this point in the history
) (fluent#4434)

On some environment, PTHREAD_STACK_MIN is less than pagesize.
The coro stack size is less than page size and it causes aborting coro stack size error.
This patch is to ensure minimum coro stack size is greater equal pagesize.

Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
  • Loading branch information
nokute78 authored and 0Delta committed Jan 20, 2022
1 parent 59d3833 commit 9aef005
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/flb_config.c
Expand Up @@ -232,6 +232,11 @@ struct flb_config *flb_config_init()

/* Set default coroutines stack size */
config->coro_stack_size = FLB_CORO_STACK_SIZE_BYTE;
if (config->coro_stack_size < getpagesize()) {
flb_info("[config] changing coro_stack_size from %u to %u bytes",
config->coro_stack_size, getpagesize());
config->coro_stack_size = (unsigned int)getpagesize();
}

/* Initialize linked lists */
mk_list_init(&config->collectors);
Expand Down

0 comments on commit 9aef005

Please sign in to comment.