From: noreply@... Date: 2007-01-22T09:29:25+09:00 Subject: [ ruby-Bugs-8050 ] SystemStackError thrown if ruby_init is called on a longer stack than other ruby functions Bugs item #8050, was opened at 2007-01-22 13:29 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=8050&group_id=426 Category: Core Group: 1.8.x Status: Open Resolution: None Priority: 3 Submitted By: Keith Bauer (onesadcookie) Assigned to: Nobody (None) Summary: SystemStackError thrown if ruby_init is called on a longer stack than other ruby functions Initial Comment: Affects all OSes other than Windows, I believe. In gc.c's Init_stack, Ruby approximates the stack start as the frame address of ruby_init. Later, when checking for stack overflows, it subtracts the address of the current frame from the stack start. That means that if ruby_init is called from a deep stack, and functions that run ruby code are called from relatively shallower stacks, it can get a negative number, which it treats as a very large unsigned number, and thinks the stack has overflowed. I've attached a patch which finds the correct stack start on Mac OS X and Linux. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=8050&group_id=426