From: wingicelee@... Date: 2015-06-04T01:52:05+00:00 Subject: [ruby-core:69460] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function. Issue #11001 has been updated by William L. L.. I also run into the bug too. ~~~ william@debianbox:~/talentlines/webui$ lsb_release -da No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 7.7 (wheezy) Release: 7.7 Codename: wheezy william@debianbox:~/talentlines/webui$ uname -a Linux debianbox 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1 x86_64 GNU/Linux william@debianbox:~/talentlines/webui$ ulimit -s 8191 william@debianbox:~/talentlines/webui$ ruby -v Segmentation fault william@debianbox:~/talentlines/webui$ ulimit -s 8000 william@debianbox:~/talentlines/webui$ ruby -v ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] ~~~ ---------------------------------------- Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function. https://bugs.ruby-lang.org/issues/11001#change-52740 * Author: Kiyoka Nishiyama * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- SEGV depends on stack limit size with 'ulimit -s ' . This shell script [ulimit_change_test.sh] can reproduce SEGV on my Debian environment. my Linux environment is Debian/GNU Linux 7.8. But, I cannot reproduce this SEGV on Amazon Linux environment. result on Debian 7.8 ~~~ $ /tmp/ulimit_change_test.sh 8515 /tmp/ulimit_change_test.sh: 3 ���: 20470 Segmentation fault ./ruby --version 8514 /tmp/ulimit_change_test.sh: 3 ���: 20471 Segmentation fault ./ruby --version 8513 /tmp/ulimit_change_test.sh: 3 ���: 20472 Segmentation fault ./ruby --version 8512 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8511 /tmp/ulimit_change_test.sh: 3 ���: 20475 Segmentation fault ./ruby --version 8510 /tmp/ulimit_change_test.sh: 3 ���: 20476 Segmentation fault ./ruby --version 8509 /tmp/ulimit_change_test.sh: 3 ���: 20477 Segmentation fault ./ruby --version 8508 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8507 /tmp/ulimit_change_test.sh: 3 ���: 20480 Segmentation fault ./ruby --version 8506 /tmp/ulimit_change_test.sh: 3 ���: 20481 Segmentation fault ./ruby --version 8505 /tmp/ulimit_change_test.sh: 3 ���: 20482 Segmentation fault ./ruby --version 8504 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8503 /tmp/ulimit_change_test.sh: 3 ���: 20485 Segmentation fault ./ruby --version 8502 /tmp/ulimit_change_test.sh: 3 ���: 20486 Segmentation fault ./ruby --version 8501 /tmp/ulimit_change_test.sh: 3 ���: 20487 Segmentation fault ./ruby --version 8500 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8499 /tmp/ulimit_change_test.sh: 3 ���: 20490 Segmentation fault ./ruby --version 8498 /tmp/ulimit_change_test.sh: 3 ���: 20491 Segmentation fault ./ruby --version 8497 /tmp/ulimit_change_test.sh: 3 ���: 20492 Segmentation fault ./ruby --version 8496 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8495 /tmp/ulimit_change_test.sh: 3 ���: 20495 Segmentation fault ./ruby --version 8494 /tmp/ulimit_change_test.sh: 3 ���: 20496 Segmentation fault ./ruby --version 8493 /tmp/ulimit_change_test.sh: 3 ���: 20497 Segmentation fault ./ruby --version 8492 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] 8491 /tmp/ulimit_change_test.sh: 3 ���: 20500 Segmentation fault ./ruby --version 8490 /tmp/ulimit_change_test.sh: 3 ���: 20501 Segmentation fault ./ruby --version 8489 /tmp/ulimit_change_test.sh: 3 ���: 20502 Segmentation fault ./ruby --version $ ~~~ This SEGV occurs in reserve_stack() function. I suspect that the buf[0x100] size is too small for margin. I attached patch to fix it. ---Files-------------------------------- 0001-Bugfix-patch-of-reserve_stack-function.patch (720 Bytes) ulimit_change_test.sh (211 Bytes) -- https://bugs.ruby-lang.org/