Issue #10460 has been updated by Eric Wong.


 arne / arnebrasseur.net wrote:
 > Was it rude to set this as "Priority: High"? A random segfault seems
 > important but it also seems very few tickets are actually marked as
 > high priority.
 
 I don't think it is rude to set "Priority: High", but I don't care much
 for "formal" ticket tracking, either.  I will work on issues which
 interest me.  (I don't speak for the rest of ruby-core)
 
 To me, segfaults in normal/otherwise-working code are important.
 However, this issues with stack overflows, your code is still
 broken even if we avoid segfaults and raise.
 
 Ruby is trying to be nice about reporting the error; but in the end,
 your code is still broken if it overflows stack.
 
 So we make a minor effort to report small overflows, but (as you can see
 from this ticket), it is highly sensitive to compiler and platform
 changes; and big overflows are not caught.
 
 We may increase the size of the guard area; but that costs memory.
 Right now, on (most) Linux systems, this guard costs 4K (one page)
 per-thread.  Increasing it may help with reporting, but your code
 is still broken; and you penalize the majority of users who do not
 overflow stack.
 
 I suspect more users care about memory usage than getting a proper
 error on broken code.

----------------------------------------
Bug #10460: Segfault instead of stack level too deep
https://bugs.ruby-lang.org/issues/10460#change-50010

* Author: Arne Brasseur
* Status: Open
* Priority: High
* Assignee: Koichi Sasada
* Category: YARV
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-10-29 trunk 48188) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
The code to trigger this can be found here: https://gist.github.com/mbj/31163a8e712573877268

Also have a look at the comments there. A lot of different people tried it, in some cases it segfaults, in others it doesn't. It seems to have to do with version of gcc or specific CFLAGS. 

I can reproduce the problem for 2.1.3, 2.1.4, and trunk.



-- 
https://bugs.ruby-lang.org/