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
)

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 committed Dec 11, 2021
1 parent 165420c commit 45eae42
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;
if (config->coro_stack_size < getpagesize()) {
config->coro_stack_size = (unsigned int)getpagesize();
flb_info("[config] change coro_stack_size %u -> %u bytes",
FLB_CORO_STACK_SIZE, config->coro_stack_size);
}

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

0 comments on commit 45eae42

Please sign in to comment.