layout depth conflict with custom funcallable sequence class
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I'm trying to replicate the first example from "User-extensible sequences in Common Lisp" but SBCL master (e75515a6a) and SBCL 2.4.0 (both built with "--fancy") report an error with these two definitions (the behavior is the same whether or not I define "queue" first or second):
(defclass queue (standard-object sequence)
((%data :accessor %queue-data)
(%pointer :accessor %queue-pointer)))
(defclass funcallable-queue (queue sb-mop:
()
(:metaclass sb-mop:
When the second class is being defined, an error shows up as follows:
layout depth conflict: #(#<SB-
I believe the example should still work as presented in the paper, hopefully this is the correct way to write it (I added "sb-mop:" in front of two symbols).
A call to (map () #'describe *) where * stands for the vector of layouts gives:
#<SB-KERNEL:LAYOUT (ID=340) for T {50101003}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = 0
CLOS-HASH = 2917193494582000972
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #()
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 340
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=129) for SEQUENCE {50101233}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = 8589934848
CLOS-HASH = 2973156064943342943
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 129
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=341) for SB-PCL::SLOT-OBJECT {50111463}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = -8589934592
CLOS-HASH = 3457679566203737886
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 341
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=342) for STANDARD-OBJECT {501134D3}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = -8589934076
CLOS-HASH = 3541692201902988558
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 342
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=128) for FUNCTION {50101153}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = 8589934592
CLOS-HASH = 3376082816255072221
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 128
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=343) for SB-MOP:
[structure-
Slots with :INSTANCE allocation:
FLAGS = -8589934076
CLOS-HASH = 4312183694679772690
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 343
ID-WORD1 = 0
ID-WORD2 = 0
#<SB-KERNEL:LAYOUT (ID=345) for QUEUE {502E5303}>
[structure-
Slots with :INSTANCE allocation:
FLAGS = -8589933820
CLOS-HASH = 2843883459518754746
CLASSOID = #<SB-KERNEL:
INVALID = NIL
INHERITS = #(#<SB-
%INFO = NIL
EQUALP-IMPL = 0
STRUCT-SLOT-MAP = 0
SLOT-TABLE = #(1 NIL)
ID-WORD0 = 345
ID-WORD1 = 0
ID-WORD2 = 0
NIL
The above is from SBCL 2.4.0, started with --no-userinit. The same happens in the terminal without Slime etc, in which case the *features* are:
(:ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT :ANSI-CL :COMMON-LISP :ELF
:IEEE-
:SB-CORE-
:UNIX)
Linux aperture 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Thank you
Changed in sbcl: | |
status: | Triaged → Fix Committed |
assignee: | Christophe Rhodes (csr21-cantab) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Thanks for the report. I think I have a fix for this, but we're in the freeze period (and I also need to test it a bit more extensively). Expect a fix to land early next month. (The fix is basically undoing commit 17945c81f96b406 d3cbc6bfd73c009 0e6ce92c6b, plus adding a lot of test cases :-)