[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

And one more thing...



For fun, let's walk through MzScheme and see what happens:

Breakpoint 1, main (argc=1, argv=0xbffffa34) at ./main.c:218
218       mzscheme_stack_start = (void *)&start2;
(gdb) n
222       GC_set_stack_base(mzscheme_stack_start);
(gdb) p (unsigned long)mzscheme_stack_start
$1 = 3221223880
(gdb) 
(gdb) break is_stack_too_shallow
Breakpoint 2 at 0x8081e20: file ./process.c, line 1620.
(gdb) c
Continuing.
Welcome to MzScheme version 103 (sgc), Copyright (c) 1995-2000 PLT (Matthew Flatt)
(thread  
(lambda () (begin
(display "hello")
(sleep 2)
(display "world"))))

Breakpoint 2, is_stack_too_shallow () at ./process.c:1620
1620      return is_stack_too_shallow2();
(gdb) p _stk_pos
$2 = 3221220648
(gdb) p scheme_stack_boundary
$3 = 3212885272
(gdb) 

Comparing to my program I have:

                         MzScheme                 Brent's Program
mzscheme_stack_start     3221223880               3206544060
_stk_pos                 3221220648               3206543056
scheme_stack_boundary    3212885272               3204501004

Delta (start/_stk_pos)   3232                     1004
Delta (start/bondary)    8338608                  2043056

So now I'm not so sure my numbers are so "off".  It seems that
my _stk_pos is far closer to mzscheme_stack_start than the
MzScheme build.  But MzScheme happily runs the threaded code
any my embedded MzScheme SIGSEV's every time.

So I'm stuck.  Maybe Shririam's student can release his server 
implementation and put me out of my misery?  ;-)

-Brent