Bug#592768: complementary information

stef louise stephane.r.louise at gmail.com
Thu Oct 7 19:51:29 UTC 2010


Right here is the diagnostic of why it fails:

Compiled the stuff with CFLAGS=-g to trace the execution. Here is my diagnostic:

run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp
 -x '(and (load "init.lisp") (sys::%saveinitmem) (ext::exit))
(ext::exit t)'
Starting program: /home/luigi/comp/dev/clisp/src/lisp.run -B . -N
locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp  -x '(and
(load "init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

;; Loading file defseq.lisp ...
;; Loaded file defseq.lisp
;; Loading file backquote.lisp ...
;; Loaded file backquote.lisp
Program received signal SIGSEGV, Segmentation fault.
gc_morris2 () at spvw_garcol.d:404
404	        var object next_obj = *(gcv_object_t*)p;
(gdb) bt
#0  gc_morris2 () at spvw_garcol.d:404
#1  gar_col_normal () at spvw_garcol.d:2327
#2  0x10028158 in do_gar_col_simple () at spvw_garcol.d:3028
#3  0x100eecd8 in with_gc_statistics (fun=0x10028110
<do_gar_col_simple>) at predtype.d:3162
#4  0x10020adc in gar_col_simple (need=184, heapptr=<value optimized
out>) at spvw_garcol.d:3036
#5  make_space_gc_true (need=184, heapptr=<value optimized out>) at
spvw_allocate.d:282
#6  0x10022028 in allocate_xrecord_ (flags_rectype=38, reclen=22,
recxlen=88) at spvw_typealloc.d:428
#7  0x100244a8 in allocate_stream (strmflags=<value optimized out>,
strmtype=12 '\f',
    reclen=<value optimized out>, recxlen=<value optimized out>) at
spvw_typealloc.d:445
#8  0x10074404 in make_buffered_stream (type=<value optimized out>,
direction=DIRECTION_INPUT_IMMUTABLE,
    eltype=0xffff6440, handle_regular=true,
handle_blockpositioning=true) at stream.d:7928
#9  0x10075708 in make_file_stream
(direction=DIRECTION_INPUT_IMMUTABLE, append_flag=false,
handle_fresh=true)
    at stream.d:8143
#10 0x10057448 in open_file (filename=<value optimized out>,
direction=DIRECTION_INPUT_IMMUTABLE,
    if_exists=647131784, if_not_exists=<value optimized out>) at pathname.d:6872
#11 0x10057648 in C_open () at pathname.d:6916
#12 0x1002fafc in eval_fsubr (form=0x69a102c3) at eval.d:3263
#13 eval1 (form=0x69a102c3) at eval.d:3101
#14 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#15 0x1003191c in funcall_iclosure (closure=<value optimized out>,
args_pointer=0xf7d5129c, argcount=1)
    at eval.d:2744
#16 0x1003bb68 in eval_closure (closure=<value optimized out>) at eval.d:3935
#17 0x1002fdb8 in eval1 (form=0x69a0f9bb) at eval.d:3091
#18 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#19 0x10047c34 in C_setq () at control.d:199
#20 0x1002fafc in eval_fsubr (form=0x69a0fa0b) at eval.d:3263
#21 eval1 (form=0x69a0fa0b) at eval.d:3101
#22 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#23 0x1003fecc in C_if () at control.d:1200
#24 0x1002fafc in eval_fsubr (form=0x69a0fa1b) at eval.d:3263
#25 eval1 (form=0x69a0fa1b) at eval.d:3101
#26 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#27 0x100439cc in C_tagbody () at control.d:1645
#28 0x1002fafc in eval_fsubr (form=0x69a0fd3b) at eval.d:3263
#29 eval1 (form=0x69a0fd3b) at eval.d:3101
#30 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#31 0x10047138 in C_labels () at control.d:1031
#32 0x1002fafc in eval_fsubr (form=0x69a0d1db) at eval.d:3263
#33 eval1 (form=0x69a0d1db) at eval.d:3101
#34 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#35 0x100449e8 in C_block () at control.d:1318
#36 0x1002fafc in eval_fsubr (form=0x69a0d1bb) at eval.d:3263
#37 eval1 (form=0x69a0d1bb) at eval.d:3101
#38 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#39 0x1003191c in funcall_iclosure (closure=<value optimized out>,
args_pointer=0xf7d51154, argcount=3)
    at eval.d:2744
#40 0x1003bb68 in eval_closure (closure=<value optimized out>) at eval.d:3935
#41 0x1002fdb8 in eval1 (form=0x69a0f293) at eval.d:3091
#42 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#43 0x1004536c in C_multiple_value_setq () at control.d:1894
#44 0x1002fafc in eval_fsubr (form=0x69a0f2b3) at eval.d:3263
#45 eval1 (form=0x69a0f2b3) at eval.d:3101
#46 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#47 0x1003191c in funcall_iclosure (closure=<value optimized out>,
args_pointer=0x101fc15d,
    argcount=1772146296) at eval.d:2744
#48 0x1003bb68 in eval_closure (closure=<value optimized out>) at eval.d:3935
#49 0x1002fdb8 in eval1 (form=0x69a048c3) at eval.d:3091
#50 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#51 0x10030d7c in eval_5env (form=<value optimized out>,
var_env=<value optimized out>,
    fun_env=<value optimized out>, block_env=<value optimized out>,
go_env=<value optimized out>,
    decl_env=<value optimized out>) at eval.d:1087
#52 0x100e1ed8 in C_load () at debug.d:606
#53 0x1002fafc in eval_fsubr (form=0x69a3126b) at eval.d:3263
#54 eval1 (form=0x69a3126b) at eval.d:3101
#55 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#56 0x1003fc58 in C_and () at control.d:2479
#57 0x1002fafc in eval_fsubr (form=0x69a31273) at eval.d:3263
#58 eval1 (form=0x69a31273) at eval.d:3101
#59 0x10030bbc in eval (form=<value optimized out>) at eval.d:2966
#60 0x100e32c0 in C_read_eval_print () at debug.d:409
#61 0x1002ca1c in funcall_subr (fun=0x101f595e, args_on_stack=<value
optimized out>) at eval.d:5227
#62 0x100e24f0 in driver () at debug.d:490
#63 0x100293b8 in main_actions (p=<value optimized out>) at spvw.d:3632
#64 0x1002a914 in main (argc=17, argv=0xffffe1d8) at spvw.d:3885
(gdb) info registers
r0             0xf7d511fb	4157936123
r1             0xffff5e30	4294925872
r2             0xf7fcd4a0	4160541856
r3             0x26927288	647131784
r4             0x69a36000	1772314624
r5             0x1020b620	270579232
r6             0x1	1
r7             0x69a36000	1772314624
r8             0x69a04898	1772112024
r9             0x77d511f8	2010452472
r10            0x69a21310	1772229392
r11            0x69a21313	1772229395
r12            0x1	1
r13            0x10213544	270611780
r14            0x2	2
r15            0x1020a5bc	270575036
r16            0x101fc15d	270516573
r17            0x10210000	270598144
r18            0x69a36000	1772314624
r19            0x268d9000	646811648
r20            0xffff5e40	4294925888
r21            0x1020b594	270579092
r22            0x100161b0	268526000
r23            0x1020b668	270579304
r24            0x2	2
r25            0x69a36000	1772314624
r26            0x26927288	647131784
r27            0x26927288	647131784
r28            0xffff5ea0	4294925984
r29            0x1020a5bc	270575036
r30            0x1020b610	270579216
r31            0xffff5e70	4294925936
pc             0x100274e0	0x100274e0 <gar_col_normal+6784>
msr            0xd032	53298
cr             0x48022448	1208099912
lr             0x10027400	0x10027400 <gar_col_normal+6560>
ctr            0x10027c2c	268598316
xer            0x20000000	536870912
orig_r3        0x0	0
trap           0x300	768
info line *0x100274e0
Line 404 of "spvw_garcol.d" starts at address 0x100274e0 <gar_col_normal+6784>
   and ends at 0x100274e4 <gar_col_normal+6788>.
(gdb) disas 0x100274e0 0x100274e4
Dump of assembler code from 0x100274e0 to 0x100274e4:
0x100274e0 <gar_col_normal+6784>:	lwz     r0,0(r9)
End of assembler dump.
(gdb) x /1w 0x77d511f8
0x77d511f8:	Cannot access memory at address 0x77d511f8
(gdb) list *0x100274e0
0x100274e0 is in gar_col_normal (spvw_garcol.d:404).
399	     #else  /* no TYPECODES */
400	      /* the so far registered pointers to this cell are updated: */
401	      while ((as_oint(obj) & wbit(garcol_bit_o)) != 0) { /* process list */
402	        obj = without_mark_bit(obj);
403	        var aint p = (aint)ThePointer(obj);
404	        var object next_obj = *(gcv_object_t*)p;
405	        *(gcv_object_t*)p = as_object((as_oint(obj) &
nonimmediate_bias_mask) | (oint)p2);
406	        obj = next_obj;
407	      }
408	      /* if the cell contains a pointer "to the right", it is reversed. */
(gdb) print obj
$3 = (object) 0xf7d511fb
(gdb) disas 0x10027400 0x10027500
Dump of assembler code from 0x100274b0 to 0x10027500:
0x100274b0 <gar_col_normal+6736>:	lwz     r10,48(r30)
0x100274b4 <gar_col_normal+6740>:	cmpw    cr7,r8,r7
0x100274b8 <gar_col_normal+6744>:	add     r10,r8,r10
0x100274bc <gar_col_normal+6748>:	beq     cr7,0x10027510 <gar_col_normal+6832>
0x100274c0 <gar_col_normal+6752>:	lwz     r0,0(r8)
0x100274c4 <gar_col_normal+6756>:	cmpwi   cr7,r0,0
0x100274c8 <gar_col_normal+6760>:	beq     cr7,0x10027504 <gar_col_normal+6820>
0x100274cc <gar_col_normal+6764>:	bge     cr7,0x100274f0 <gar_col_normal+6800>
0x100274d0 <gar_col_normal+6768>:	rlwinm  r9,r0,0,1,29
0x100274d4 <gar_col_normal+6772>:	clrlwi  r11,r0,1
0x100274d8 <gar_col_normal+6776>:	clrlwi  r11,r11,30
0x100274dc <gar_col_normal+6780>:	or      r11,r11,r10
0x100274e0 <gar_col_normal+6784>:	lwz     r0,0(r9)
0x100274e4 <gar_col_normal+6788>:	stw     r11,0(r9)
0x100274e8 <gar_col_normal+6792>:	cmpwi   cr7,r0,0
0x100274ec <gar_col_normal+6796>:	blt     cr7,0x100274d0 <gar_col_normal+6768>
0x100274f0 <gar_col_normal+6800>:	clrlwi  r9,r0,29
0x100274f4 <gar_col_normal+6804>:	cmpwi   cr7,r9,3
0x100274f8 <gar_col_normal+6808>:	beq     cr7,0x100279b0 <gar_col_normal+8016>
0x100274fc <gar_col_normal+6812>:	stw     r0,0(r8)
End of assembler dump.
(gdb)

So, as you can see, the main loop of the while (line 401-407 of source
code) is translated by the assembly loop from 0x100274d0 to 0x100274ec
(only for one of the two conditions, but whatever -- the first test
obj!=NULL is in 0x100274c4). The local variable "p" is in register
"r9", and as you can see, "obj" is "r0". I don't know what is supposed
to do the cast(?) in line 403 but it is translated in assembly at
address 0x100274d0: what do this "rlwinm" instruction is to drop the
first and the 2 last bits of the value of "r0" and put it in "r9".

Hence, the value of "r0" is 0xf7d511fb and a logical consequence is
that r9 is 0x77d511f8.

I suspect that the intended action would be to only cast the two last
bits of "obj" for alining on a 32bit boundary.
(gdb) x /1w 0xf7d511f8
0xf7d511f8:	270516573

So it would be a valid address contrary to 0x77d511f8. So I suspect a
bad macro or function in line 403. You may want to know that PPC
architecture is very different than x86 for much more than endianness
(e.g. char are unsigned by default with gcc gnu/linux-ppc).

Is the information suffisant?

Stéphane





More information about the pkg-common-lisp-devel mailing list