[前][次][番号順一覧][スレッド一覧]

ruby-changes:59963

From: Yusuke <ko1@a...>
Date: Sun, 9 Feb 2020 12:56:01 +0900 (JST)
Subject: [ruby-changes:59963] a28c166f78 (master): gc.c: make the stack overflow detection earlier under s390x

https://git.ruby-lang.org/ruby.git/commit/?id=a28c166f78

From a28c166f787710227c6aac54befd72778f041485 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Sun, 9 Feb 2020 12:53:18 +0900
Subject: gc.c: make the stack overflow detection earlier under s390x

On s390x, TestFiber#test_stack_size fails with SEGV.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20200205T223421Z.fail.html.gz

```
TestFiber#test_stack_size [/home/chkbuild/build/20200205T223421Z/ruby/test/ruby/test_fiber.rb:356]:
pid 23844 killed by SIGABRT (signal 6) (core dumped)
| -e:1:in `times': stack level too deep (SystemStackError)
| 	from -e:1:in `rec'
| 	from -e:1:in `block (3 levels) in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `block (2 levels) in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `block in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `rec'
| 	 ... 172 levels...
| 	from -e:1:in `block in rec'
| 	from -e:1:in `times'
| 	from -e:1:in `rec'
| 	from -e:1:in `block in <main>'
| -e: [BUG] Segmentation fault at 0x0000000000000000
```

This change tries a similar fix with
ef64ab917eec02491f6bf7233a4031a8c35385e3 and
3ddbba84b5b1f001cd575a48cec56d7ce8e5fbb2.

diff --git a/gc.c b/gc.c
index a9400b5..2c7de4f 100644
--- a/gc.c
+++ b/gc.c
@@ -4690,7 +4690,14 @@ stack_check(rb_execution_context_t *ec, int water_mark) https://github.com/ruby/ruby/blob/trunk/gc.c#L4690
 #define stack_check(ec, water_mark) FALSE
 #endif
 
+#ifdef __s390x__
+/* Experimentally make the stack overflow detection earlier under s390x
+ * https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20200205T223421Z.fail.html.gz
+ */
+#define STACKFRAME_FOR_CALL_CFUNC 8192
+#else
 #define STACKFRAME_FOR_CALL_CFUNC 2048
+#endif
 
 MJIT_FUNC_EXPORTED int
 rb_ec_stack_check(rb_execution_context_t *ec)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]