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

Re: GC Errors in Embedded Program (Final for tonight -- Honest)



I tried one more iteration, this time using the Senora GC and everything
setup as it should be.  I think this *might* have a chance of working,
but it still fails.

[29/Dec/2000:22:17:44][11114.4101][-nssock-] Notice: nssock: starting
[29/Dec/2000:22:17:44][11114.4101][-nssock-] Notice: nssock: listening on http://hopper (127.0.0.1:80)
[29/Dec/2000:22:17:44][11114.4101][-nssock-] Notice: nssock: accepting connections
[New Thread 5126 (LWP 11132)]
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: serv: starting: waiting for connections
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: MV_PageGet: url /test.ss
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Notice: MachV:  Handle a request...
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: Apply thunk/catch-excn (Enter)
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: Init_exn_catching
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: Creating thunk.
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: Get namespace
[29/Dec/2000:22:17:58][11114.5126][-conn0-] Debug: Evaluate the string.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5126 (LWP 11132)]
0x4036cbf6 in semi_collect_stack (offset=0) at collect.inc:119
119           unsigned long p = ADD_LOCAL_OFFSET(PTR_TO_INT(d));
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5126 (LWP 11132)]
#0  0x4036cbf6 in semi_collect_stack (offset=0) at collect.inc:119
#1  0x4036ce20 in prepare_stack_collect () at ./sgc.c:3511

0x4036cbf6 in semi_collect_stack (offset=0) at collect.inc:119
119           unsigned long p = ADD_LOCAL_OFFSET(PTR_TO_INT(d));
(gdb) bt
#2  0x4036d155 in push_stack (stack_now=0xbefff1f0) at ./sgc.c:3563
#3  0x4036def1 in do_GC_gcollect (stack_now=0xbefff1f0) at ./sgc.c:4382
#4  0x4036e065 in GC_gcollect () at ./sgc.c:4622
#5  0x4036c046 in do_malloc (set_no=0, size=384, common=0x4037dc40, 
    othersptr=0x4037e040, flags=0) at ./sgc.c:2345
#6  0x4036c36b in GC_malloc (size=336) at ./sgc.c:2525
#7  0x403273b8 in scheme_top_level_do (k=0x4034df50 <scheme_internal_read_k>, 
    eb=0) at ./fun.c:846
#8  0x4034e020 in scheme_read_syntax (port=0x81df210, stxsrc=0x4037e25c)
    at ./read.c:884
#9  0x40322e12 in scheme_eval_string_all (
    str=0x40370ca0 "(#%lambda (thunk) (#%with-handlers ([#%void (#%lambda (exn) (#%cons #f exn))]) (#%cons #t (thunk))))", env=0x81ef170, cont=-1)
    at ./eval.c:3638
#10 0x40322e66 in scheme_eval_string (
    str=0x40370ca0 "(#%lambda (thunk) (#%with-handlers ([#%void (#%lambda (exn) 
    (#%cons #f exn))]) (#%cons #t (thunk))))", env=0x81ef170) at ./eval.c:3652
#11 0x403184f9 in init_exn_catching_apply () at ns_interps.cc:109
#12 0x40318593 in _apply_thunk_catch_exceptions (f=0x8219a90, exn=0xbefff550)
    at ns_interps.cc:127
#13 0x4031870c in MV_InterpreterPool::Eval (this=0x815c5f8, conn=0x8241ca0
    s=0x40370143 "(+ 1 2)") at ns_interps.cc:288
#14 0x403133cb in MV_PageGet (ignored=0x0, conn=0x8241ca0) at ns_machv.cc:386
#15 0x8077d6a in Ns_ConnRunRequest ()
#16 0x807e62e in NsConnThread ()
#17 0x807df5e in NsConnThread ()
#18 0x81190fb in NsThreadMain ()
#19 0x4002dcb5 in pthread_start_thread () from /lib/libpthread.so.0
#20 0x4002dcfd in pthread_start_thread_event () from /lib/libpthread.so.0
(gdb) 

Rerunning with a breakpoint set:

[New Thread 5126 (LWP 11241)]
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: serv: starting: waiting for connections
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: MV_PageGet: url /test.ss
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Notice: MachV:  Handle a request...
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: Apply thunk/catch-excn (Enter)
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: Init_exn_catching
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: Creating thunk.
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: Get namespace
[29/Dec/2000:22:33:39][11226.5126][-conn0-] Debug: Evaluate the string.
[Switching to Thread 5126 (LWP 11241)]

Breakpoint 1, prepare_stack_collect () at ./sgc.c:3508
3508      s = collect_stack[--collect_stack_count];
(gdb) n
3510      PUSH_COLLECT(s, e, source);
(gdb) p s
$1 = 3204444656
(gdb) p e
$2 = 3221218757
(gdb) p source
No symbol "source" in current context.
(gdb) step
3511      semi_collect_stack(0);
(gdb) step
0x4036cb91 in semi_collect_stack (offset=0) at ./sgc.c:3377
3377    }
(gdb) s
0x4036cc6a in semi_collect_stack (offset=0) at collect.inc:163
163                     bpos = POS_TO_UNMARK_INDEX(pos);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x4036cbf6 in semi_collect_stack (offset=0) at collect.inc:119
119           unsigned long p = ADD_LOCAL_OFFSET(PTR_TO_INT(d));

(gdb) p end
$3 = 3221218754
(gdb) p s
$4 = 3204448256
(gdb) p d

I suspect it's a problem with it finding the stack again, but my
knowledge of GC minutia is pretty pathetic.

So, unless someone smart on this list has:
(1) managed to get MzScheme working in a multi-threaded environment
    in which it was *not* running the "main" thread and can offer
    some words of encouragement...
- or -
(2) ...someone has ideas on how to further debug this...

...then, I'm going to probably declare this AOLserver embedment
dormant for the time being and start playing with the 
HTTP-server-in-scheme that Shriram is (hopefully) going to unveil 
soon?  ;-)

Thanks,

-Brent