Skip to content

Commit

Permalink
MINSIGSTKSZ is no longer constant in glibc (#41860)
Browse files Browse the repository at this point in the history
MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) starting from glibc 2.34

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
(cherry picked from commit f19b9a2)
  • Loading branch information
t-bltg authored and KristofferC committed Nov 12, 2021
1 parent ff0566f commit 09a49c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <inttypes.h>
#include "julia.h"
Expand Down Expand Up @@ -75,8 +76,8 @@ static inline void tsan_switch_to_ctx(jl_ucontext_t *ctx) {}

// empirically, jl_finish_task needs about 64k stack space to infer/run
// and additionally, gc-stack reserves 64k for the guard pages
#if defined(MINSIGSTKSZ) && MINSIGSTKSZ > 131072
#define MINSTKSZ MINSIGSTKSZ
#if defined(MINSIGSTKSZ)
#define MINSTKSZ (MINSIGSTKSZ > 131072 ? MINSIGSTKSZ : 131072)
#else
#define MINSTKSZ 131072
#endif
Expand Down

0 comments on commit 09a49c6

Please sign in to comment.