Maybe someone can now rename this issue to a name better reflecting the actual problem, it seems like a pretty general memory allocation bug that can causes many different code patterns to produce a crash. I also have reproduced the same...jaroslawr (Jarosław Rzeszótko)
A still more simple test case for apparently the same problem: https://gist.github.com/anonymous/a86f5eb0198acc10ae1e It really isn't simply an unhandled stack overflow. If you decrease the number of allocations, the program runs j...jaroslawr (Jarosław Rzeszótko)
Given that this is a BUS error, here is perhaps a particularly interesting backtrace you can get if you are "lucky": ~~~ #0 0xaf9e3187 in _int_memalign (av=av@entry=0xafb00420 <main_arena>, alignment=alignment@entry=16384, bytes=byt...jaroslawr (Jarosław Rzeszótko)
Some more findings, you can run the above test case under gdb like this: ~~~ # gdb ruby (gdb) set disable-randomization off (gdb) run test.rb ~~~ The test program does not crash with randomization disabled in gdb, nor does it c...jaroslawr (Jarosław Rzeszótko)
Here is a stripped down and easier to understand test case: https://gist.github.com/anonymous/a2a784c9f37b1fc6b753 Basically, the bigger the M, the lower N is needed to trigger the crash. On my computer, just nesting 100 lambdas is...jaroslawr (Jarosław Rzeszótko)
I have seen #10460 and would not say this is an obvious duplicate. Here, it is not only that you do not get a stack overflow, it seems that the C stack grows up abnormally quickly when you nest lambdas and method calls, compared to just ...jaroslawr (Jarosław Rzeszótko)
By the way, even more strange things happen if you replace the simple call to test with something like: ~~~ruby t1 = Thread.new { test } t2 = Thread.new { test } t1.join t2.join ~~~ I get then the following error: ~~~ test...jaroslawr (Jarosław Rzeszótko)
I get a BUS error from executing the following Ruby program: https://gist.github.com/jaroslawr/8579678d7c68a49208f0 I am on Gentoo Linux and Ruby 2.1.5, and have also tried Ruby 2.1.4, 2.1.3, ..., down to 2.1.0. My colleagues The prob...jaroslawr (Jarosław Rzeszótko)