You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows a thread's stack is 1 MB (ironruby.exe's main thread and Thread.new threads alike, as far as observed); Linux's main thread has 8 MB. Recursive walks in the runtime reach correspondingly less depth on Windows:
Ractor.make_shareable / Ractor#send copying a nested Array: fine at 1,500 levels on Windows, SystemStackError at 2,000 (Linux handles 2,000 easily). Ractor_DeepGraph1 was cut from 2,000 to 1,000 levels in Retire 2016-era code and bring the core closer to CRuby 4.0 #119 for this reason.
CRuby on Windows links ruby.exe with a larger stack reserve than the 1 MB default, so programs that recurse moderately deep work there and not on IronRuby.
Options:
Give ironruby.exe/ir.exe a larger stack reserve (PE header, e.g. via editbin /STACK after build, or run the main script on a thread created with a larger maxStackSize, as StackGuard already does for prism walks).
Create Thread.new threads with a larger maxStackSize.
For the Ractor copier specifically, continue on StackGuard.RunOnLargeStack when the stack runs low (careful: initialize_copy would then run Ruby code on another CLR thread).
Activity