From 592d762b35805e9cb3fe9eb439ecfce1477fa04a Mon Sep 17 00:00:00 2001 From: Juan Francisco Cantero Hurtado Date: Fri, 12 Apr 2013 04:00:44 +0200 Subject: [PATCH] Change the default stack size to safe values on OpenBSD. With this patch racket will never grow beyond of the defaults limits of the OS and also it doesn't limit the stack size to a fixed value. Merge to v5.3.4 (cherry picked from commit 5a566771e089d5ff5c7881080cd2e0e73a61b5da) --- src/racket/sconfig.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/racket/sconfig.h b/src/racket/sconfig.h index 4792b83495..4dc2053232 100644 --- a/src/racket/sconfig.h +++ b/src/racket/sconfig.h @@ -295,15 +295,21 @@ # define SCHEME_PLATFORM_LIBRARY_SUBPATH "i386-openbsd" # endif -/* Same reason as for FreeBSD? */ -# define ASSUME_FIXED_STACK_SIZE -# define FIXED_STACK_SIZE 1048576 +# include +# if OpenBSD < 201211 +/* This is needed for (pre-5.2) userspace threads: */ +# define ASSUME_FIXED_STACK_SIZE +# define FIXED_STACK_SIZE 1048576 +# endif # include "uconfig.h" # undef HAS_STANDARD_IOB - # define HAS_BSD_IOB +/* Default UNIX_STACK_MAXIMUM is too big for a non-root user. */ +# undef UNIX_STACK_MAXIMUM +# define UNIX_STACK_MAXIMUM 4194304 + #ifndef __ELF__ # define UNDERSCORE_DYNLOAD_SYMBOL_PREFIX #endif