ts wrote:
>
>  break point in stack_check() or in rb_call0() when it call stack_check()
>  (it's probably inlined) and see what value it has

Here's what I did and found, but I am not sure what you mean by "value it has",
i.e., I need more hand-holding.

  gdb /path/to/ruby-1.8.1/ruby

  (gdb) break stack_check
  Breakpoint 1 at 0x4000000000011c31: file eval.c, line 4758.

  (gdb) r helloLevel.rb
  Starting program: /u/.realmounts/staff/schang/ruby-1.8.1/ruby helloLevel.rb
  hello world! 0
  hello world! 1
  hello world! 2
  hello world! 3
  hello world! 4
  hello world! 5
  hello world! 6
  hello world! 7

  Breakpoint 1, stack_check () at eval.c:4758
  4758        if (!overflowing && ruby_stack_check()) {

  (gdb) p STACK_LEVEL_MAX
  $1 = 49152

  (gdb) c
  Continuing.
  hello world! 8
  hello world! 9
  [..]
  hello world! 43
  hello world! 44

  Breakpoint 1, stack_check () at eval.c:4758
  4758        if (!overflowing && ruby_stack_check()) {

  (gdb) p STACK_LEVEL_MAX
  $2 = 49152

  (gdb) list
  4753    static inline void
  4754    stack_check()
  4755    {
  4756        static int overflowing = 0;
  4757
  4758        if (!overflowing && ruby_stack_check()) {
  4759            int state;
  4760            overflowing = 1;
  4761            PUSH_TAG(PROT_NONE);
  4762            if ((state = EXEC_TAG()) == 0) {
  (gdb) list
  4763                rb_exc_raise(sysstack_error);
  4764            }
  4765            POP_TAG();
  4766            overflowing = 0;
  4767            JUMP_TAG(state);
  4768        }
  4769    }

  (gdb) bt
  #0  stack_check () at eval.c:4758
  #1  0x4000000000050320 in rb_call0 (klass=2305843009219151112, recv=89, id=43,
      oid=43, argc=1, argv=0x60000fffffea3d20, body=0x20000000005342d8,
      nosuper=0) at eval.c:5031
  #2  0x4000000000054190 in rb_call (klass=2305843009219151112, recv=89, mid=43,
      argc=1, argv=0x60000fffffea3d20, scope=0) at eval.c:5287
  #3  0x4000000000036850 in $_1$rb_eval$TAG$GLOB () at eval.c:3076
  #4  0x4000000000036f70 in $_1$rb_eval$TAG$GLOB () at eval.c:3086
  #5  0x40000000000528e0 in rb_call0 (klass=2305843009219189312,
      recv=2305843009219179552, id=10193, oid=10193, argc=0,
      argv=0x60000fffffeb0e08, body=0x200000000051c458, nosuper=0) at eval.c:5194
  #6  0x4000000000054190 in rb_call (klass=2305843009219189312,
      recv=2305843009219179552, mid=10193, argc=1, argv=0x60000fffffeb0e00,
      scope=1) at eval.c:5287
  #7  0x4000000000037220 in $_1$rb_eval$TAG$GLOB () at eval.c:3091
  #8  0x40000000000528e0 in rb_call0 (klass=2305843009219189312,
      recv=2305843009219179552, id=10193, oid=10193, argc=0,
      argv=0x60000fffffeb83c8, body=0x200000000051c458, nosuper=0) at eval.c:5194
  #9  0x4000000000054190 in rb_call (klass=2305843009219189312,
      recv=2305843009219179552, mid=10193, argc=1, argv=0x60000fffffeb83c0,
      scope=1) at eval.c:5287
  [..]

-- 
Bil Kleb, Hampton, Virginia