aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authorUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-24 18:22:33 +0900
committerUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-26 15:59:40 +0900
commitfa09acafde3b7dbb23edadc6eddcce27f7395880 (patch)
tree556da2019bd99f4fb0ebef2f9da56296ce129d62 /vm_core.h
parent1f4204a762b2ddcc2f235b1a2b6a10071ef90d3b (diff)
downloadruby-fa09acafde3b7dbb23edadc6eddcce27f7395880.tar.gz
extend machine stacks when sanitizers are there
It seems sanitizers require extra amount of machine stacks. Without extending them the process tends to stack overflow.
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index 2c38911d58..95cd2d87d9 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -698,6 +698,18 @@ typedef struct rb_vm_struct {
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
#endif
+#if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer)
+/* It seems sanitizers consume A LOT of machine stacks */
+#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE
+#define RUBY_VM_THREAD_MACHINE_STACK_SIZE (1024 * 1024 * sizeof(VALUE))
+#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN
+#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 512 * 1024 * sizeof(VALUE))
+#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE
+#define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 256 * 1024 * sizeof(VALUE))
+#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN
+#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 128 * 1024 * sizeof(VALUE))
+#endif
+
/* optimize insn */
#define INTEGER_REDEFINED_OP_FLAG (1 << 0)
#define FLOAT_REDEFINED_OP_FLAG (1 << 1)