Mac OSX, X Ruby and Tk

Whilst hunting down what I thought was a bug in my code I found a
problem with Ruby/Tk under X on Mac OSX.

Here’s an example of the error…

[public2-brig5-6-cust105:ext/tk/sample] peterhickman% ruby tkdialog.rb
/sw/lib/ruby/1.6/tk.rb:121:in tk_split_simplelist': stack level too deep (SystemStackError) from /sw/lib/ruby/1.6/tk.rb:117:ineach_byte’
from /sw/lib/ruby/1.6/tk.rb:117:in tk_split_simplelist' from /sw/lib/ruby/1.6/tk.rb:130:intk_split_simplelist’
from /sw/lib/ruby/1.6/tk.rb:130:in tk_split_simplelist' from /sw/lib/ruby/1.6/tk.rb:130:intk_split_simplelist’
from /sw/lib/ruby/1.6/tk.rb:130:in tk_split_simplelist' from /sw/lib/ruby/1.6/tk.rb:130:intk_split_simplelist’
from /sw/lib/ruby/1.6/tk.rb:130:in tk_split_simplelist' ... 15 levels... from tkdialog.rb:14 from tkdialog.rb:9:innew’
from tkdialog.rb:9:in `new’
from tkdialog.rb:9
[public2-brig5-6-cust105:ext/tk/sample] peterhickman%

There are other examples but this is the easiest as it is from the Ruby
sources.

Here’s my setup.

Mac OSX 10.2.3, fully patched
X11 - Apples and Fink (tested Apple X11, Oroborous(?) and Fink X11)
Ruby 1-6-7 from fink linked to the tcltk sources that came from Fink.

Most of the other Tk samples work. I got this error at first when trying
to call my own class within Tk that was trying to call the REXML and so
spent many fruitless hours hunting bugs in REXML and (my own) SIE before
going back to first principals in bug hunting.

Any idea as to where this error is comming from?

Best I can tell is that your stack is too small. There have
been posts on this in the past. I’m not sure why apple set
the default to 512 kbytes.

Try setting your stacksize as shown below and re-running.

jdf@localhost (ttyp1) 167 /Users/jdf % limit
cputime unlimited
filesize unlimited
datasize 6144 kbytes
stacksize 512 kbytes
coredumpsize 0 kbytes
memoryuse unlimited
descriptors 256
memorylocked unlimited
maxproc 100
jdf@localhost (ttyp1) 168 /Users/jdf % limit stacksize
stacksize 512 kbytes
jdf@localhost (ttyp1) 169 /Users/jdf % limit stacksize 65536
jdf@localhost (ttyp1) 170 /Users/jdf % limit stacksize
stacksize 65536 kbytes

···

On Thursday, 16 January 2003 at 21:33:45 +0900, Peter Hickman wrote:

[public2-brig5-6-cust105:ext/tk/sample] peterhickman% ruby tkdialog.rb
/sw/lib/ruby/1.6/tk.rb:121:in `tk_split_simplelist’: stack level too
deep (SystemStackError)


Jim Freeze

Weiler’s Law:
Nothing is impossible for the man who doesn’t have to do it
himself.

Jim Freeze wrote:

Best I can tell is that your stack is too small. There have
been posts on this in the past. I’m not sure why apple set
the default to 512 kbytes.

Thanks I will give that a try.