gcl-devel
[Top][All Lists]
Advanced

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

RE: [Gcl-devel] HEAD Maxima and HEAD trad GCL


From: Mike Thomas
Subject: RE: [Gcl-devel] HEAD Maxima and HEAD trad GCL
Date: Wed, 14 Jan 2004 18:01:32 +1000

Hi again.

| As it happens, it doesn't get anywhere near to the call
| instructions as the
| program crashes in the instruction at offset 0x13d where the instruction:
|
| mov    0x0,%ecx
|
| tries to execute.  I presume %ecx means "the address held in the ecx
| register"?  The content of ecx is 0x63c.


static void L2()
{register object *base=vs_base;
     130:       55                      push   %ebp
     131:       57                      push   %edi
     132:       56                      push   %esi
     133:       53                      push   %ebx
     134:       83 ec 1c                sub    $0x1c,%esp
     137:       8b 35 00 00 00 00       mov    0x0,%esi
        register object *sup=base+VM2; VC2
        vs_check;
     13d:       8b 0d 00 00 00 00       mov    0x0,%ecx

vs_check is defined in cmpinclude.h as:

 #define        vs_check        if (vs_top >= vs_limit)  \
                                vs_overflow()

and VC2 is just a declaration:

 #define VC2 object  V24 ,V23 ,V9;

I retraced my steps a little here by tracing through to the point in
cmpaux.c when FUNC at() is called in call_init() at line 333.

Up to the point of that call, the stack as revealed by "bt" makes sense.
After stepping with "s" into at() which lands in call_or_link(), the stack
is apparently wasted as far as "bt" is concerned.  Likewise before that "s"
command, ecx seems to be valid, but after is set to 0x63c.  This sequence is
set out below:

333         (*at)();
(gdb) bt
#0  call_init (init_address=0, memory=0x1032ab2c, fasl_vec=0x1028732c,
fptr=0)
    at cmpaux.c:333
#1  0x0046ed0f in fasload (faslfile=0x1033845c) at sfasl.c:443
#2  0x004289d6 in Lload () at file.d:1840
#3  0x0041f2f7 in eval (form=0x541330) at eval.c:1090
#4  0x004595c5 in For (args=0x102385dc) at predicate.c:762
#5  0x0041f087 in eval (form=0x1023860c) at eval.c:1037
#6  0x0041dab7 in funcall (fun=0x102a27c8) at eval.c:327
#7  0x0041dd71 in funcall_no_event (fun=0x102570a8) at eval.c:381
#8  0x0041f304 in eval (form=0x541330) at eval.c:1092
#9  0x0046090a in Fprogn (body=0x102384a4) at prog.c:248
#10 0x0043e0eb in FletA (form=0x102384d4) at let.c:110
#11 0x0041f087 in eval (form=0x10238588) at eval.c:1037
#12 0x0041dab7 in funcall (fun=0x102a2870) at eval.c:327
#13 0x0041dd71 in funcall_no_event (fun=0x10256eac) at eval.c:381
#14 0x0041f304 in eval (form=0x541330) at eval.c:1092
#15 0x00419e20 in Fcase (arg=0x1022e4b0) at conditional.c:135
#16 0x0041f087 in eval (form=0x1022e498) at eval.c:1037
#17 0x0046090a in Fprogn (body=0x1022e48c) at prog.c:248
#18 0x0043df4b in Flet (form=0x1022e480) at let.c:82
#19 0x0041f087 in eval (form=0x1022e474) at eval.c:1037
#20 0x0046090a in Fprogn (body=0x1022e468) at prog.c:248
#21 0x0043df4b in Flet (form=0x1023cab0) at let.c:82
#22 0x0041f087 in eval (form=0x1023caf8) at eval.c:1037
#23 0x0043b9f1 in Floop (form=0x1023cb04) at iteration.c:57
#24 0x0041f087 in eval (form=0x1023cb64) at eval.c:1037
#25 0x0046090a in Fprogn (body=0x1023c9b4) at prog.c:248
#26 0x0041f087 in eval (form=0x1023cb70) at eval.c:1037
#27 0x0046090a in Fprogn (body=0x1023c9a8) at prog.c:248
#28 0x0043f082 in Flabels (args=0x1023984c) at let.c:277
#29 0x0041f087 in eval (form=0x10238690) at eval.c:1037
#30 0x0046090a in Fprogn (body=0x1023c99c) at prog.c:248
#31 0x0043e0eb in FletA (form=0x1023869c) at let.c:110
#32 0x0041f087 in eval (form=0x10238780) at eval.c:1037
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb) p *at
$30 = {int ()} 0x10339000

(gdb) info registers
eax            0x5422f8 5513976
ecx            0x77c3d99a       2009323930
edx            0x10109048       269520968
ebx            0x22e160 2285920
esp            0x22c230 0x22c230
ebp            0x22c248 0x22c248
esi            0x22e160 2285920
edi            0x22e160 2285920
eip            0x4190b2 0x4190b2
eflags         0x202    514
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x38     56
gs             0x0      0
(gdb) s

Breakpoint 1, call_or_link (sym=0x1019a630, link=0x1032857c) at funlink.c:71
71                  ( *(void (*)()) (fun->cf.cf_self)) ();
(gdb) bt
#0  call_or_link (sym=0x1019a630, link=0x1032857c) at funlink.c:71
#1  0x10327b77 in ?? ()
#2  0x1019a630 in ?? ()
#3  0x1032857c in ?? ()
#4  0x10356d74 in ?? ()
#5  0x103194b7 in ?? ()
#6  0x10301f78 in ?? ()
#7  0x005a5860 in small_fixnum_table ()
#8  0x10341fdc in ?? ()
#9  0x103194eb in ?? ()
#10 0x00000630 in ?? ()
#11 0x00000630 in ?? ()
#12 0x005b0f0c in value_stack ()
#13 0x10399e28 in ?? ()
#14 0x10341fdc in ?? ()
#15 0x10287fa4 in ?? ()
#16 0x005b0f1c in value_stack ()
#17 0x005b0f08 in value_stack ()
#18 0x005b0ef8 in value_stack ()
#19 0x005a7ca0 in sLAprint_baseA ()
#20 0x0022bee8 in ?? ()
#21 0x004314ec in call_or_link (sym=0x1000001, link=0x5) at funlink.c:71
#22 0x00000004 in ?? ()
#23 0x01000001 in ?? ()
#24 0x00000005 in ?? ()
#25 0x01000001 in ?? ()
#26 0x00000006 in ?? ()
#27 0x01000001 in ?? ()
#28 0x00000007 in ?? ()
#29 0x01000001 in ?? ()
#30 0x00000008 in ?? ()
#31 0x01000001 in ?? ()
#32 0x00000009 in ?? ()
#33 0x01000001 in ?? ()
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb) info registers
eax            0x10317130       271675696
ecx            0x63c    1596
edx            0x1032857c       271746428
ebx            0x5b0f18 5967640
esp            0x22be80 0x22be80
ebp            0x22be88 0x22be88
esi            0x5b0ef8 5967608
edi            0x5b0f10 5967632
eip            0x4314e4 0x4314e4
eflags         0x202    514
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x38     56
gs             0x0      0
(gdb)



So I broke at line 333 while loading pcl_braid.o again and this time instead
of step I used stepi, checking for disassembly and "bt".  The ?? entries
starts acumulating on the stack straight away and disassembly is not
possible in some places, but OK in others??? :




0x004190b5      333         (*at)();
(gdb) bt
#0  0x004190b5 in call_init (init_address=0, memory=0x1032ab2c,
    fasl_vec=0x1028732c, fptr=0) at cmpaux.c:333
#1  0x0046ed0f in fasload (faslfile=0x1033845c) at sfasl.c:443
#2  0x004289d6 in Lload () at file.d:1840
#3  0x0041f2f7 in eval (form=0x541330) at eval.c:1090
#4  0x004595c5 in For (args=0x102385dc) at predicate.c:762
#5  0x0041f087 in eval (form=0x1023860c) at eval.c:1037
#6  0x0041dab7 in funcall (fun=0x102a27c8) at eval.c:327
#7  0x0041dd71 in funcall_no_event (fun=0x102570a8) at eval.c:381
#8  0x0041f304 in eval (form=0x541330) at eval.c:1092
#9  0x0046090a in Fprogn (body=0x102384a4) at prog.c:248
#10 0x0043e0eb in FletA (form=0x102384d4) at let.c:110
#11 0x0041f087 in eval (form=0x10238588) at eval.c:1037
#12 0x0041dab7 in funcall (fun=0x102a2870) at eval.c:327
#13 0x0041dd71 in funcall_no_event (fun=0x10256eac) at eval.c:381
#14 0x0041f304 in eval (form=0x541330) at eval.c:1092
#15 0x00419e20 in Fcase (arg=0x1022e4b0) at conditional.c:135
#16 0x0041f087 in eval (form=0x1022e498) at eval.c:1037
#17 0x0046090a in Fprogn (body=0x1022e48c) at prog.c:248
#18 0x0043df4b in Flet (form=0x1022e480) at let.c:82
#19 0x0041f087 in eval (form=0x1022e474) at eval.c:1037
#20 0x0046090a in Fprogn (body=0x1022e468) at prog.c:248
#21 0x0043df4b in Flet (form=0x1023cab0) at let.c:82
#22 0x0041f087 in eval (form=0x1023caf8) at eval.c:1037
#23 0x0043b9f1 in Floop (form=0x1023cb04) at iteration.c:57
#24 0x0041f087 in eval (form=0x1023cb64) at eval.c:1037
#25 0x0046090a in Fprogn (body=0x1023c9b4) at prog.c:248
#26 0x0041f087 in eval (form=0x1023cb70) at eval.c:1037
#27 0x0046090a in Fprogn (body=0x1023c9a8) at prog.c:248
#28 0x0043f082 in Flabels (args=0x1023984c) at let.c:277
#29 0x0041f087 in eval (form=0x10238690) at eval.c:1037
#30 0x0046090a in Fprogn (body=0x1023c99c) at prog.c:248
#31 0x0043e0eb in FletA (form=0x1023869c) at let.c:110
#32 0x0041f087 in eval (form=0x10238780) at eval.c:1037
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb) stepi
0x10339000 in ?? ()
(gdb) bt
#0  0x10339000 in ?? ()
#1  0x004190b7 in call_init (init_address=0, memory=0x1032ab2c,
    fasl_vec=0x1028732c, fptr=0) at cmpaux.c:333
#2  0x0046ed0f in fasload (faslfile=0x1033845c) at sfasl.c:443
#3  0x004289d6 in Lload () at file.d:1840
#4  0x0041f2f7 in eval (form=0x541330) at eval.c:1090
#5  0x004595c5 in For (args=0x102385dc) at predicate.c:762
#6  0x0041f087 in eval (form=0x1023860c) at eval.c:1037
#7  0x0041dab7 in funcall (fun=0x102a27c8) at eval.c:327
#8  0x0041dd71 in funcall_no_event (fun=0x102570a8) at eval.c:381
#9  0x0041f304 in eval (form=0x541330) at eval.c:1092
#10 0x0046090a in Fprogn (body=0x102384a4) at prog.c:248
#11 0x0043e0eb in FletA (form=0x102384d4) at let.c:110
#12 0x0041f087 in eval (form=0x10238588) at eval.c:1037
#13 0x0041dab7 in funcall (fun=0x102a2870) at eval.c:327
#14 0x0041dd71 in funcall_no_event (fun=0x10256eac) at eval.c:381
#15 0x0041f304 in eval (form=0x541330) at eval.c:1092
#16 0x00419e20 in Fcase (arg=0x1022e4b0) at conditional.c:135
#17 0x0041f087 in eval (form=0x1022e498) at eval.c:1037
#18 0x0046090a in Fprogn (body=0x1022e48c) at prog.c:248
#19 0x0043df4b in Flet (form=0x1022e480) at let.c:82
#20 0x0041f087 in eval (form=0x1022e474) at eval.c:1037
#21 0x0046090a in Fprogn (body=0x1022e468) at prog.c:248
#22 0x0043df4b in Flet (form=0x1023cab0) at let.c:82
#23 0x0041f087 in eval (form=0x1023caf8) at eval.c:1037
#24 0x0043b9f1 in Floop (form=0x1023cb04) at iteration.c:57
#25 0x0041f087 in eval (form=0x1023cb64) at eval.c:1037
#26 0x0046090a in Fprogn (body=0x1023c9b4) at prog.c:248
#27 0x0041f087 in eval (form=0x1023cb70) at eval.c:1037
#28 0x0046090a in Fprogn (body=0x1023c9a8) at prog.c:248
#29 0x0043f082 in Flabels (args=0x1023984c) at let.c:277
#30 0x0041f087 in eval (form=0x10238690) at eval.c:1037
#31 0x0046090a in Fprogn (body=0x1023c99c) at prog.c:248
#32 0x0043e0eb in FletA (form=0x1023869c) at let.c:110
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb) disassemble
No function contains program counter for selected frame.

(gdb) stepi
0x10339003 in ?? ()
(gdb) disassemble
No function contains program counter for selected frame.

(gdb) bt
#0  0x10339003 in ?? ()
#1  0xffffffff in ?? ()
#2  0x0022c248 in ?? ()
#3  0x00418ff0 in call_init (init_address=0, memory=0x1032ab2c,
    fasl_vec=0x1028732c, fptr=0) at cmpaux.c:315
#4  0x0046ed0f in fasload (faslfile=0x1033845c) at sfasl.c:443
#5  0x004289d6 in Lload () at file.d:1840
#6  0x0041f2f7 in eval (form=0x541330) at eval.c:1090
#7  0x004595c5 in For (args=0x102385dc) at predicate.c:762
#8  0x0041f087 in eval (form=0x1023860c) at eval.c:1037
#9  0x0041dab7 in funcall (fun=0x102a27c8) at eval.c:327
#10 0x0041dd71 in funcall_no_event (fun=0x102570a8) at eval.c:381
#11 0x0041f304 in eval (form=0x541330) at eval.c:1092
#12 0x0046090a in Fprogn (body=0x102384a4) at prog.c:248
#13 0x0043e0eb in FletA (form=0x102384d4) at let.c:110
#14 0x0041f087 in eval (form=0x10238588) at eval.c:1037
#15 0x0041dab7 in funcall (fun=0x102a2870) at eval.c:327
#16 0x0041dd71 in funcall_no_event (fun=0x10256eac) at eval.c:381
#17 0x0041f304 in eval (form=0x541330) at eval.c:1092
#18 0x00419e20 in Fcase (arg=0x1022e4b0) at conditional.c:135
#19 0x0041f087 in eval (form=0x1022e498) at eval.c:1037
#20 0x0046090a in Fprogn (body=0x1022e48c) at prog.c:248
#21 0x0043df4b in Flet (form=0x1022e480) at let.c:82
#22 0x0041f087 in eval (form=0x1022e474) at eval.c:1037
#23 0x0046090a in Fprogn (body=0x1022e468) at prog.c:248
#24 0x0043df4b in Flet (form=0x1023cab0) at let.c:82
#25 0x0041f087 in eval (form=0x1023caf8) at eval.c:1037
#26 0x0043b9f1 in Floop (form=0x1023cb04) at iteration.c:57
#27 0x0041f087 in eval (form=0x1023cb64) at eval.c:1037
#28 0x0046090a in Fprogn (body=0x1023c9b4) at prog.c:248
#29 0x0041f087 in eval (form=0x1023cb70) at eval.c:1037
#30 0x0046090a in Fprogn (body=0x1023c9a8) at prog.c:248
#31 0x0043f082 in Flabels (args=0x1023984c) at let.c:277
#32 0x0041f087 in eval (form=0x10238690) at eval.c:1037
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb)
(gdb) info registers
eax            0x10339000       271814656
ecx            0x77c3d99a       2009323930
edx            0x10109048       269520968
ebx            0x22e160 2285920
esp            0x22c214 0x22c214
ebp            0x22c248 0x22c248
esi            0x22e160 2285920
edi            0x22e160 2285920
eip            0x10339003       0x10339003
eflags         0x206    518
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x38     56
gs             0x0      0
(gdb) stepi
0x10339008 in ?? ()
(gdb) stepi
do_init (statVV=0x1033ef80) at cmpaux.c:366
366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) stepi
0x00419120      366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) stepi
0x00419122      366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) info registers
eax            0x10339000       271814656
ecx            0x77c3d99a       2009323930
edx            0x10109048       269520968
ebx            0x22e160 2285920
esp            0x22c208 0x22c208
ebp            0x22c208 0x22c208
esi            0x22e160 2285920
edi            0x22e160 2285920
eip            0x419122 0x419122
eflags         0x206    518
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x38     56
gs             0x0      0
(gdb) stepi
366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) stepi
0x0041912a      366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) stepi
0x0041912d      366     {object fasl_vec=sSPinit->s.s_dbind;
(gdb) stepi
367      object data = sSPmemory->s.s_dbind;
(gdb) stepi
0x00419135      367      object data = sSPmemory->s.s_dbind;
(gdb) stepi
0x00419138      367      object data = sSPmemory->s.s_dbind;
(gdb) bt
#0  0x00419138 in do_init (statVV=0x1033ef80) at cmpaux.c:367
#1  0x1033900d in ?? ()
#2  0x1033ef80 in ?? ()
#3  0xffffffff in ?? ()
#4  0x0022c248 in ?? ()
#5  0x00418ff0 in call_init (init_address=0, memory=0x1032ab2c,
    fasl_vec=0x1028732c, fptr=0) at cmpaux.c:315
#6  0x0046ed0f in fasload (faslfile=0x1033845c) at sfasl.c:443
#7  0x004289d6 in Lload () at file.d:1840
#8  0x0041f2f7 in eval (form=0x541330) at eval.c:1090
#9  0x004595c5 in For (args=0x102385dc) at predicate.c:762
#10 0x0041f087 in eval (form=0x1023860c) at eval.c:1037
#11 0x0041dab7 in funcall (fun=0x102a27c8) at eval.c:327
#12 0x0041dd71 in funcall_no_event (fun=0x102570a8) at eval.c:381
#13 0x0041f304 in eval (form=0x541330) at eval.c:1092
#14 0x0046090a in Fprogn (body=0x102384a4) at prog.c:248
#15 0x0043e0eb in FletA (form=0x102384d4) at let.c:110
#16 0x0041f087 in eval (form=0x10238588) at eval.c:1037
#17 0x0041dab7 in funcall (fun=0x102a2870) at eval.c:327
#18 0x0041dd71 in funcall_no_event (fun=0x10256eac) at eval.c:381
#19 0x0041f304 in eval (form=0x541330) at eval.c:1092
#20 0x00419e20 in Fcase (arg=0x1022e4b0) at conditional.c:135
#21 0x0041f087 in eval (form=0x1022e498) at eval.c:1037
#22 0x0046090a in Fprogn (body=0x1022e48c) at prog.c:248
#23 0x0043df4b in Flet (form=0x1022e480) at let.c:82
#24 0x0041f087 in eval (form=0x1022e474) at eval.c:1037
#25 0x0046090a in Fprogn (body=0x1022e468) at prog.c:248
#26 0x0043df4b in Flet (form=0x1023cab0) at let.c:82
#27 0x0041f087 in eval (form=0x1023caf8) at eval.c:1037
#28 0x0043b9f1 in Floop (form=0x1023cb04) at iteration.c:57
#29 0x0041f087 in eval (form=0x1023cb64) at eval.c:1037
#30 0x0046090a in Fprogn (body=0x1023c9b4) at prog.c:248
#31 0x0041f087 in eval (form=0x1023cb70) at eval.c:1037
#32 0x0046090a in Fprogn (body=0x1023c9a8) at prog.c:248
---Type <return> to continue, or q <return> to quit---q
Quit (expect signal SIGINT when the program is resumed)
(gdb) disassemble
Dump of assembler code for function do_init:
0x0041911f <do_init+0>: push   %ebp
0x00419120 <do_init+1>: mov    %esp,%ebp
0x00419122 <do_init+3>: sub    $0x28,%esp
0x00419125 <do_init+6>: mov    0x540bb0,%eax
0x0041912a <do_init+11>:        mov    0x4(%eax),%eax
0x0041912d <do_init+14>:        mov    %eax,0xfffffffc(%ebp)
0x00419130 <do_init+17>:        mov    0x5411a0,%eax
0x00419135 <do_init+22>:        mov    0x4(%eax),%eax
0x00419138 <do_init+25>:        mov    %eax,0xfffffff8(%ebp)
0x0041913b <do_init+28>:        mov    0xfffffffc(%ebp),%eax
0x0041913e <do_init+31>:        mov    0x10(%eax),%eax
0x00419141 <do_init+34>:        dec    %eax
0x00419142 <do_init+35>:        mov    %eax,0xffffffe8(%ebp)
0x00419145 <do_init+38>:        sub    $0x8,%esp
0x00419148 <do_init+41>:        push   $0xc
0x0041914a <do_init+43>:        pushl  0xfffffffc(%ebp)
0x0041914d <do_init+46>:        call   0x477112 <check_type>
0x00419152 <do_init+51>:        add    $0x10,%esp
0x00419155 <do_init+54>:        mov    0xfffffffc(%ebp),%ecx
0x00419158 <do_init+57>:        mov    0xffffffe8(%ebp),%eax
0x0041915b <do_init+60>:        lea    0x0(,%eax,4),%edx
0x00419162 <do_init+67>:        mov    0xc(%ecx),%eax
0x00419165 <do_init+70>:        mov    (%eax,%edx,1),%eax
0x00419168 <do_init+73>:        mov    %eax,0xffffffe0(%ebp)
0x0041916b <do_init+76>:        sub    $0x8,%esp
0x0041916e <do_init+79>:        push   $0x0
0x00419170 <do_init+81>:        pushl  0xffffffe0(%ebp)
0x00419173 <do_init+84>:        call   0x477112 <check_type>
0x00419178 <do_init+89>:        add    $0x10,%esp
0x0041917b <do_init+92>:        mov    0xfffffffc(%ebp),%eax
0x0041917e <do_init+95>:        movw   $0x3,0xa(%eax)
0x00419184 <do_init+101>:       mov    0xfffffffc(%ebp),%edx
0x00419187 <do_init+104>:       mov    0xfffffffc(%ebp),%eax
---Type <return> to continue, or q <return> to quit---


I'm off for the train now.

Mike Thomas.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]