[Ecls-list] Bug in compiling methods for unfinalized classes.

Alexander Gavrilov angavrilov at gmail.com
Wed Nov 4 13:36:55 UTC 2009


Hi, 

If you try to compile a method for an unfinalized class,
the compiler tries to access an unbound class-precedence-list
slot and crashes:

CL-USER[1]> (defclass foo (bar) ())
;;; Warning: Class BAR has been forward referenced.
#<The STANDARD-CLASS FOO>
CL-USER[2]> (funcall (compile nil '(lambda () (defmethod xxx ((x foo))))))
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;; Internal error: Not a proper list UNBOUND
The function NIL is undefined.

The same will happen if you simply write those two definitions
in a file and try to compile it.


A stack trace:

#0  FEtype_error_proper_list (x=0x7ffff7ed5520) at /home/sasha/SysAdm/ProgramAdm/ecl/src/c/typespec.d:56          
#1  0x00007ffff7bf24bc in si_memq (x=0xd49db0, l=0x7ffff7ed5520) at /home/sasha/SysAdm/ProgramAdm/ecl/src/c/list.d:878
#2  0x00007ffff7b51cd1 in si_subclassp (narg=2, V1=0x2b81390, V2=0xd49db0) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:1719
#3  0x00007ffff7b51da8 in LC62__g189 (V1=0x2b81390, V2=0xd49db0) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:2597          
#4  0x00007ffff7b4f368 in L54find_type_bounds (V1=<value optimized out>, V2=0x2ba0dc0, V3=<value optimized out>, V4=<value optimized out>)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:2242                                                                         
#5  0x00007ffff7b53707 in L55register_type (V1=0xd49db0, V2=0x2ba0dc0, V3=0x2ba0d80)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:2308
#6  0x00007ffff7b55498 in L63register_class (V1=0xd49db0) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:2553
#7  0x00007ffff7b53b4a in L79canonical_type (V1=0x7ffff7ee0b60) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:3407
#8  0x00007ffff7b54838 in L80safe_canonical_type (V1=0x7ffff7ee0b60) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:3654
#9  0x00007ffff7b54a60 in L81fast_subtypep (V1=0x2b77510, V2=0x7ffff7ee0b60) at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:3677
#10 0x00007ffff7b54d99 in cl_subtypep (narg=<value optimized out>, V1=0x2b77510, V2=0x7ffff7ee0b60)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/lsp/predlib.c:3766
#11 0x00007ffff6e74bbb in L3type_filter (narg=<value optimized out>, V1=0x2b77510)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/cmp/cmptype.c:259
#12 0x00007ffff6eaf4f5 in L12c1make_var (V1=0x7ffff7ee0350, V2=0x1, V3=0x1, V4=<value optimized out>)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/cmp/cmpvar.c:398
#13 0x00007ffff6e90ab7 in L10c1lambda_expr (narg=<value optimized out>, V1=<value optimized out>)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/cmp/cmplam.c:579
#14 0x00007ffff6e91d26 in L7c1compile_function (narg=<value optimized out>, V1=0x2b9f861)
    at /home/sasha/SysAdm/ProgramAdm/ecl/build/cmp/cmplam.c:168
...

Alexander




More information about the ecl-devel mailing list