ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:68637] [Ruby trunk - Bug #11001] [Open] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
@ 2015-03-25 14:04 ` kiyoka
  2015-06-04  1:52 ` [ruby-core:69460] [Ruby trunk - Bug #11001] " wingicelee
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: kiyoka @ 2015-03-25 14:04 UTC (permalink / raw)
  To: ruby-core

Issue #11001 has been reported by Kiyoka Nishiyama.

----------------------------------------
Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function.
https://bugs.ruby-lang.org/issues/11001

* 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 <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69460] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
  2015-03-25 14:04 ` [ruby-core:68637] [Ruby trunk - Bug #11001] [Open] 2.2.1 Segmentation fault in reserve_stack() function kiyoka
@ 2015-06-04  1:52 ` wingicelee
  2015-06-04  9:49 ` [ruby-core:69462] [Ruby trunk - Bug #11001] [Feedback] " nobu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: wingicelee @ 2015-06-04  1:52 UTC (permalink / raw)
  To: ruby-core

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 <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69462] [Ruby trunk - Bug #11001] [Feedback] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
  2015-03-25 14:04 ` [ruby-core:68637] [Ruby trunk - Bug #11001] [Open] 2.2.1 Segmentation fault in reserve_stack() function kiyoka
  2015-06-04  1:52 ` [ruby-core:69460] [Ruby trunk - Bug #11001] " wingicelee
@ 2015-06-04  9:49 ` nobu
  2015-06-27  4:49 ` [ruby-core:69751] [Ruby trunk - Bug #11001] " kubo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: nobu @ 2015-06-04  9:49 UTC (permalink / raw)
  To: ruby-core

Issue #11001 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Feedback
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: UNKNOWN

Does it happen with recent versions?

----------------------------------------
Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function.
https://bugs.ruby-lang.org/issues/11001#change-52749

* Author: Kiyoka Nishiyama
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: UNKNOWN
----------------------------------------
SEGV depends on stack limit size with 'ulimit -s <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69751] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-06-04  9:49 ` [ruby-core:69462] [Ruby trunk - Bug #11001] [Feedback] " nobu
@ 2015-06-27  4:49 ` kubo
  2015-06-27  6:08   ` [ruby-core:69752] " Eric Wong
  2015-06-28  1:33 ` [ruby-core:69759] " nobu
  2015-06-28  5:26 ` [ruby-core:69760] " kubo
  5 siblings, 1 reply; 8+ messages in thread
From: kubo @ 2015-06-27  4:49 UTC (permalink / raw)
  To: ruby-core

Issue #11001 has been updated by Takehiro Kubo.


Same issue with recent ruby versions on Ubuntu 12.04.

I tried it with recent OS versions and found that
* Ubuntu 12.04 - Segmentation fault
* Ubuntu 12.10 - Segmentation fault
* Ubuntu 13.04 - No problem
* Ubuntu 14.04 - No problem
* Ubuntu 15.04 - No problem
* Debian 8.1 - No problem

IMO, this may be an issue of OS, not of ruby.


----------------------------------------
Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function.
https://bugs.ruby-lang.org/issues/11001#change-53128

* Author: Kiyoka Nishiyama
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: UNKNOWN
----------------------------------------
SEGV depends on stack limit size with 'ulimit -s <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69752] Re: [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
  2015-06-27  4:49 ` [ruby-core:69751] [Ruby trunk - Bug #11001] " kubo
@ 2015-06-27  6:08   ` Eric Wong
  2015-06-27 23:38     ` [ruby-core:69758] " SASADA Koichi
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Wong @ 2015-06-27  6:08 UTC (permalink / raw)
  To: Ruby developers

kubo@jiubao.org wrote:
> IMO, this may be an issue of OS, not of ruby.

Fwiw, valgrind chokes here, too.

I tested valgrind 3.9.0 on CentOS 7.0 and also backported to
Debian 7.0 (wheezy).

I comment reserve_stack out when I'm debugging other problems
with valgrind.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69758] Re: [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
  2015-06-27  6:08   ` [ruby-core:69752] " Eric Wong
@ 2015-06-27 23:38     ` SASADA Koichi
  0 siblings, 0 replies; 8+ messages in thread
From: SASADA Koichi @ 2015-06-27 23:38 UTC (permalink / raw)
  To: ruby-core

On 2015/06/27 15:08, Eric Wong wrote:
> Fwiw, valgrind chokes here, too.

Try it before valgrind.

$ ulimit -s unlimited

-- 
// SASADA Koichi at atdot dot net

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69759] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2015-06-27  4:49 ` [ruby-core:69751] [Ruby trunk - Bug #11001] " kubo
@ 2015-06-28  1:33 ` nobu
  2015-06-28  5:26 ` [ruby-core:69760] " kubo
  5 siblings, 0 replies; 8+ messages in thread
From: nobu @ 2015-06-28  1:33 UTC (permalink / raw)
  To: ruby-core

Issue #11001 has been updated by Nobuyoshi Nakada.


Takehiro Kubo wrote:
> IMO, this may be an issue of OS, not of ruby.

Any criteria where works on or not?
Runtime kernel versions?


----------------------------------------
Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function.
https://bugs.ruby-lang.org/issues/11001#change-53136

* Author: Kiyoka Nishiyama
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: UNKNOWN
----------------------------------------
SEGV depends on stack limit size with 'ulimit -s <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:69760] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function.
       [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2015-06-28  1:33 ` [ruby-core:69759] " nobu
@ 2015-06-28  5:26 ` kubo
  5 siblings, 0 replies; 8+ messages in thread
From: kubo @ 2015-06-28  5:26 UTC (permalink / raw)
  To: ruby-core

Issue #11001 has been updated by Takehiro Kubo.


> Any criteria where works on or not?
> Runtime kernel versions?

Segmentaion fault
* Ubuntu 12.04 - kernel 3.2+
* Ubuntu 12.10 - kernel 3.5
* Debian 7.7 - kernel 3.2.63
* Debian 7.8 - kernel 3.4.105

No problem
* Ubuntu 13.04 - kernel 3.8
* Ubuntu 14.04 - kernel 3.13 or 3.16 (I deleted the VM. I don't know which is used.)
* Ubuntu 15.04 - kernel 3.19.3
* Debian 8.1 - kernel 3.16.7

Ubuntu
https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions
Debian 7.7
https://www.phoronix.com/scan.php?page=news_item&px=MTgxODY
Debian 7.8
http://news.softpedia.com/news/Debian-7-8-Arrives-with-Security-Fixes-and-Updated-Linux-Kernel-469629.shtml
Debian 8.1
http://news.softpedia.com/news/Debian-GNU-Linux-8-1-Jessie-Officially-Released-483592.shtml

On Ubuntu 12.04, stack size in emacs shell buffer is 8515 and
ruby gets segmentation fault. So I put 'ulimit -Ss 8192' in .bashrc
for workaround. (stack size in gnome-terminal is 8192.)


----------------------------------------
Bug #11001: 2.2.1 Segmentation fault in reserve_stack() function.
https://bugs.ruby-lang.org/issues/11001#change-53137

* Author: Kiyoka Nishiyama
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: UNKNOWN
----------------------------------------
SEGV depends on stack limit size with 'ulimit -s <size>' .

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-28  5:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-11001.20150325140453@ruby-lang.org>
2015-03-25 14:04 ` [ruby-core:68637] [Ruby trunk - Bug #11001] [Open] 2.2.1 Segmentation fault in reserve_stack() function kiyoka
2015-06-04  1:52 ` [ruby-core:69460] [Ruby trunk - Bug #11001] " wingicelee
2015-06-04  9:49 ` [ruby-core:69462] [Ruby trunk - Bug #11001] [Feedback] " nobu
2015-06-27  4:49 ` [ruby-core:69751] [Ruby trunk - Bug #11001] " kubo
2015-06-27  6:08   ` [ruby-core:69752] " Eric Wong
2015-06-27 23:38     ` [ruby-core:69758] " SASADA Koichi
2015-06-28  1:33 ` [ruby-core:69759] " nobu
2015-06-28  5:26 ` [ruby-core:69760] " kubo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).