From aff9dff46d79181d143697d7b9e76735788e45cc Mon Sep 17 00:00:00 2001 From: kosaki Date: Sat, 15 Dec 2012 14:20:12 +0000 Subject: * signal.c (rb_sigaltstack_size): new. calculate stack size for sigsegv handler. enlarge value when x86 or x86_64 on Linux. Linux has very small MINSIGSTKSZ size (2048 bytes) and our sigsegv routine need 5KiB at least. [Bug #7141] * internal.h: add declaration of rb_sigaltstack_size(). * vm_core.h: remove ALT_STACK_SIZE definition. * signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with rb_sigaltstack_size(); * gc.c (Init_heap): ditto. * vm.c (th_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index da15fd2675..2266754fc7 100644 --- a/vm.c +++ b/vm.c @@ -1834,7 +1834,7 @@ th_init(rb_thread_t *th, VALUE self) /* allocate thread stack */ #ifdef USE_SIGALTSTACK /* altstack of main thread is reallocated in another place */ - th->altstack = malloc(ALT_STACK_SIZE); + th->altstack = malloc(rb_sigaltstack_size()); #endif th->stack_size = RUBY_VM_THREAD_STACK_SIZE; th->stack = thread_recycle_stack(th->stack_size); -- cgit v1.2.3