Skip to content

Commit

Permalink
MINSTKSZ on linux is absurdly low. enforce some sanity on it.
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Sep 28, 2015
1 parent 6470a26 commit 22e4d96
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ static void free_stack(void *stkbuf, size_t bufsz)
}
#endif

#ifndef MINSIGSTKSZ
#define MINSIGSTKSZ 131072 // 128k
// emperically, finish_task needs about 64k stack space to infer/run
#if MINSIGSTKSZ > 65536
#define MINSTKSZ MINSIGSTKSZ
#else
#define MINSTKSZ 65536
#endif

static jl_sym_t *done_sym;
Expand Down Expand Up @@ -702,9 +705,9 @@ DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, size_t ssize)
ssize = JL_STACK_SIZE;
#endif
if (ssize != 0) {
if (ssize < MINSIGSTKSZ)
ssize = MINSIGSTKSZ;
ssize = LLT_ALIGN(ssize, pagesz);
if (ssize < MINSTKSZ)
ssize = MINSTKSZ;
ssize = LLT_ALIGN(ssize, pagesz) + pagesz;
}
t->ssize = ssize;
t->current_module = NULL;
Expand Down

0 comments on commit 22e4d96

Please sign in to comment.