gcl-devel
[Top][All Lists]
Advanced

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

RE: [Gcl-devel] Windows GCL: setjmp/longjmp


From: Mike Thomas
Subject: RE: [Gcl-devel] Windows GCL: setjmp/longjmp
Date: Thu, 25 Mar 2004 15:41:58 +1000

Hi Camm.

| > (gdb) finish
| > Run till exit from #0  0x0041f217 in eval (form=0x1135c1b0) at
| eval.c:1037
| > 0x0041f981 in fLeval (x0=0x1060fba0) at eval.c:1178
| > 1178            eval(x0);
|
| Could you start single stepping here,


There are two runs included below my signature.  The problems are, I think,
occurring in Iinvoke_c_function_from_value_stack().

On the first run there is trouble using pp with a longjump error from
MSVCRT - included in case it makes sense to you.

On the second I am a bit more careful with pp and see that base[0] is set at
line 294 to the erroneous value 0x6b83f0 as follows (I don't understand how
you know it is a bad value, incidentally) :

========================================================
294       res = COERCE_F_TYPE(res,F_RESULT_TYPE(fargd),F_object);
(gdb) n
295       base[0]=res;
(gdb) n
296       if (F_ARG_FLAGS_P(fargd,F_caller_sets_one_val))
(gdb) p pp(res)
T$7 = void
(gdb) s
300         { vs_top=base + fcall.nvalues;
(gdb) p base
$8 = (object *) 0x6c1560
(gdb) p vs_base
$9 = (object *) 0x6c15f0
(gdb) p vs_base[0]
$10 = 0x6b83f0
(gdb) p base[0]
$11 = 0x6b83f0

========================================================


and that by this stage base and vs_base have diverged widely despite being
set at the start of the function to be equal (line 266):


========================================================
(gdb) p vs_top - vs_base
$16 = 1
(gdb) p vs_top - base
$17 = 37
========================================================


I don't see in the source code how this divergence could have validly
occurred.

Incidentally, at the time of the break at mark_c_stack it looks as though
the stack is already in trouble:


========================================================
[GC for 108 STRING pages..
Breakpoint 1, mark_c_stack (env1=0x22dd90, n=0,
    fn=0x438960 <mark_stack_carefully>) at gbc.c:865
865       if (n== N_RECURSION_REQD)
(gdb) bt
#0  mark_c_stack (env1=0x22dd90, n=0, fn=0x438960 <mark_stack_carefully>)
    at gbc.c:865
#1  0x00438e28 in mark_c_stack (env1=0x22de10, n=1,
    fn=0x438960 <mark_stack_carefully>) at gbc.c:873
#2  0x00438e28 in mark_c_stack (env1=0x0, n=2,
    fn=0x438960 <mark_stack_carefully>) at gbc.c:873
#3  0x00438de3 in mark_phase () at gbc.c:793
#4  0x0043959b in GBC (t=t_string) at gbc.c:1209
#5  0x00404869 in alloc_object (t=t_string) at alloc.c:286
#6  0x004718c0 in alloc_simple_string (l=8) at string.d:42
#7  0x00475fdd in symbol_name (x=0x101b9b64) at symbol.d:440
#8  0x004760d0 in Lsymbol_name () at symbol.d:458
#9  0x0041f487 in eval (form=0x651a90) at eval.c:1090
#10 0x0041f40a in eval (form=0x106114d4) at eval.c:1077
#11 0x004485af in Fmultiple_value_list (form=0x1101e8e8) at multival.c:62
#12 0x0041f217 in eval (form=0x1101e8f4) at eval.c:1037
#13 0x004134c8 in letA_bind (body=0x10611210, start=0x6c1638, end=0x6c1668)
    at bind.c:699
#14 0x0043e67f in FletA (form=0x1101e894) at let.c:106
#15 0x0041f217 in eval (form=0x1101e8a0) at eval.c:1037
#16 0x00460b4f in Ftagbody (body=0x1101e888) at prog.c:95
#17 0x0041f217 in eval (form=0x1101e3f0) at eval.c:1037
#18 0x00419928 in Fif (form=0x1101e3d8) at conditional.c:54
---Type <return> to continue, or q <return> to quit---
#19 0x0041f217 in eval (form=0x1101e3e4) at eval.c:1037
#20 0x00460b4f in Ftagbody (body=0x1101ddec) at prog.c:95
#21 0x0041f217 in eval (form=0x1101ddbc) at eval.c:1037
#22 0x00414667 in Fblock (args=0x1101dd8c) at block.c:58
#23 0x0041f217 in eval (form=0x1101dd98) at eval.c:1037
#24 0x0046175a in Fprogn (body=0x1101dd74) at prog.c:248
#25 0x0043e50b in Flet (form=0x1101dd5c) at let.c:82
#26 0x0041f217 in eval (form=0x1101dd68) at eval.c:1037
#27 0x0046175a in Fprogn (body=0x1101e2b8) at prog.c:248
#28 0x0043eaf0 in Fmultiple_value_bind (form=0x1101e2e8) at let.c:165
#29 0x0041f217 in eval (form=0x1101e2f4) at eval.c:1037
#30 0x00460b4f in Ftagbody (body=0x1101e294) at prog.c:95
#31 0x0043d82f in Fdolist (arg=0x1101e2a0) at iteration.c:357
#32 0x0041f217 in eval (form=0x1101e2ac) at eval.c:1037
#33 0x0046175a in Fprogn (body=0x1101e288) at prog.c:248
#34 0x0043e50b in Flet (form=0x1101e270) at let.c:82
#35 0x0041f217 in eval (form=0x1101e27c) at eval.c:1037
#36 0x0046175a in Fprogn (body=0x1101e264) at prog.c:248
#37 0x0043e50b in Flet (form=0x10611570) at let.c:82
#38 0x0041f217 in eval (form=0x106115e8) at eval.c:1037
#39 0x0041f981 in fLeval (x0=0x106115e8) at eval.c:1178
#40 0x00431dc6 in c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730)
    at funlink.c:363
---Type <return> to continue, or q <return> to quit---
#41 0x0044ae21 in Iinvoke_c_function_from_value_stack (f=0x41f925 <fLeval>,
    fargd=513) at nfunlink.c:293
#42 0x0041f920 in Leval () at eval.c:1171
#43 0x104eb092 in ?? ()
#44 0x00000001 in ?? ()
#45 0x1101e9d8 in ?? ()
(gdb)
========================================================


And so I bid you farewell for another day.

Cheers

Mike homas.





==============================================================
Run till exit from #0  0x0041f217 in eval (form=0x1135c1b0) at eval.c:1037
0x0041f981 in fLeval (x0=0x1060fba0) at eval.c:1178
1178            eval(x0);
(gdb) p pp(x0)
(SIGNALS-ERROR (SYMBOL-FUNCTION)
                                PROGRAM-ERROR)$43 = void

(gdb) watch vs_base[0]
Hardware watchpoint 2: vs_base[0]
(gdb) n
1179            lex_env = lex;
(gdb) n
1180            return Ivs_values();
(gdb) n
1181    }
(gdb) n
c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730) at funlink.c:685
685      return res;
(gdb) n
686     }
(gdb) n
Iinvoke_c_function_from_value_stack (f=0x41f925 <fLeval>, fargd=513)
    at nfunlink.c:294
294       res = COERCE_F_TYPE(res,F_RESULT_TYPE(fargd),F_object);
(gdb) s
295       base[0]=res;
(gdb) p pp(res)
T$44 = void
(gdb) n
296       if (F_ARG_FLAGS_P(fargd,F_caller_sets_one_val))
(gdb) p base
$45 = (object *) 0x6c1560
(gdb) n
300         { vs_top=base + fcall.nvalues;
(gdb) p base
$46 = (object *) 0x6c1560
(gdb) p pp(base)

Program received signal SIGSEGV, Segmentation fault.
0x77c337c9 in msvcrt!_abnormal_termination ()
   from C:\WINDOWS\system32\msvcrt.dll
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (pp) will be abandoned.
(gdb) bt
#0  0x77c337c9 in msvcrt!_abnormal_termination ()
   from C:\WINDOWS\system32\msvcrt.dll
#1  0x77c37856 in strerror () from C:\WINDOWS\system32\msvcrt.dll
#2  0x77c34e9a in msvcrt!longjmp () from C:\WINDOWS\system32\msvcrt.dll
(gdb)
==============================================================



And start again:



==============================================================
(gdb) finish
Run till exit from #0  0x0041f217 in eval (form=0x1135c1b0) at eval.c:1037
0x0041f981 in fLeval (x0=0x1060fba0) at eval.c:1178
1178            eval(x0);
(gdb) p pp(x0)
(SIGNALS-ERROR (SYMBOL-FUNCTION)
                                PROGRAM-ERROR)$6 = void
(gdb) bt
#0  0x0041f981 in fLeval (x0=0x1060fba0) at eval.c:1178
#1  0x00431dc6 in c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730)
    at funlink.c:363
#2  0x0044ae21 in Iinvoke_c_function_from_value_stack (f=0x41f925 <fLeval>,
    fargd=513) at nfunlink.c:293
#3  0x0041f920 in Leval () at eval.c:1171
#4  0x104eb092 in ?? ()
#5  0x00000001 in ?? ()
#6  0x1135c57c in ?? ()
(gdb) watch vs_base[0]
Hardware watchpoint 2: vs_base[0]
(gdb) bt
#0  0x0041f981 in fLeval (x0=0x1060fba0) at eval.c:1178
#1  0x00431dc6 in c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730)
    at funlink.c:363
#2  0x0044ae21 in Iinvoke_c_function_from_value_stack (f=0x41f925 <fLeval>,
    fargd=513) at nfunlink.c:293
#3  0x0041f920 in Leval () at eval.c:1171
#4  0x104eb092 in ?? ()
#5  0x00000001 in ?? ()
#6  0x1135c57c in ?? ()
(gdb) n
1179            lex_env = lex;
(gdb) n
1180            return Ivs_values();
(gdb) n
1181    }
(gdb) n
c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730) at funlink.c:685
685      return res;
(gdb) n
686     }
(gdb) n
Iinvoke_c_function_from_value_stack (f=0x41f925 <fLeval>, fargd=513)
    at nfunlink.c:294
294       res = COERCE_F_TYPE(res,F_RESULT_TYPE(fargd),F_object);
(gdb) n
295       base[0]=res;
(gdb) n
296       if (F_ARG_FLAGS_P(fargd,F_caller_sets_one_val))
(gdb) p pp(res)
T$7 = void
(gdb) s
300         { vs_top=base + fcall.nvalues;
(gdb) p base
$8 = (object *) 0x6c1560
(gdb) p vs_base
$9 = (object *) 0x6c15f0
(gdb) p vs_base[0]
$10 = 0x6b83f0
(gdb) p base[0]
$11 = 0x6b83f0
(gdb) p fcall.nvalues
$12 = 1
(gdb) p vs_top
$13 = (object *) 0x6c15f4
(gdb) p nargs
$14 = 1
(gdb) p i
$15 = 1
(gdb) p vs_top - vs_base
$16 = 1
(gdb) p vs_top - base
$17 = 37
(gdb) p next
No symbol "next" in current context.
(gdb) n
301           { int nn = fcall.nvalues;
(gdb) n
302             while (--nn > 0)
(gdb) n
307       vs_base=base;
(gdb) p base
$18 = (object *) 0x6c1560
(gdb) p vs_base
$19 = (object *) 0x6c15f0
(gdb) n
309     }
(gdb) n
0x0041f920 in Leval () at eval.c:1171
1171           ,1,1,NONE,OO,OO,OO,OO,void,Leval,(object x0),"")
(gdb) bt
#0  0x0041f920 in Leval () at eval.c:1171
#1  0x104eb092 in ?? ()
#2  0x00000001 in ?? ()
#3  0x1135c57c in ?? ()
(gdb) n
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0x1: Input/output error.

(gdb)









 because...
|
| > (gdb) finish
| > Run till exit from #0  0x0041f981 in fLeval (x0=0x1060fba0) at
| eval.c:1178
| > 0x00431dc6 in c_apply_n (fn=0x41f925 <fLeval>, n=1, x=0x22e730)
| >     at funlink.c:363
| > 363         case 1:  res=LCAST(fn)(x[0]);break;
| > Value returned is $23 = 0x6b83f0
|                           ^^^^^^^^
|
| this is not a valid object pointer.  Perhaps pp(x0) above.

| Something
| truncated the top byte when writings to vs_base[0].  Can you
| investigate?
|
| Take care,
|
|
| --
| Camm Maguire                                          address@hidden
| ==========================================================================
| "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
|
|
| _______________________________________________
| Gcl-devel mailing list
| address@hidden
| http://mail.gnu.org/mailman/listinfo/gcl-devel
|






reply via email to

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