non-abortable call stack exhaustion on recursive class
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Jan Moringen |
Bug Description
When defining a class that has itself in the class precedence list, the call stack is exhausted in SB-PCL:
The most simple test case is here:
* (defclass my-class (my-class) ())
=> #<STANDARD-CLASS MY-CLASS>
* (defclass my-class (my-class) ())
; error ad nauseum
A more reasonable test case is here:
* (defclass foo (bar) ())
=> #<STANDARD-CLASS FOO>
* (defclass bar (foo) ())
; error ad nauseum
An error is eventually signaled, but there is no meaningful restart. Attached is a patch that causes the circularity to be caught and able to be ABORT'd from. There is a test case for both direct and arbitrary superclasses. The first (a quick sanity check of direct superclasses) will fail, since I'm not sure about the implementation for the check. I'm guessing it should go somewhere in SB-MOP:
version := sbcl-1.
uname -a := Darwin lucien-laptoop 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-
features := (CFFI-FEATURES:
CFFI-FEATURES:
:QUICKLISP :ASDF-PACKAGE-
:OS-UNIX :NON-BASE-
:ASH-RIGHT-VOPS :BSD :C-STACK-
:COMPARE-
:DARWIN9-OR-BETTER :FLOAT-EQL-VOPS :GENCGC :IEEE-FLOATING-
:INLINE-CONSTANTS :INODE64 :INTEGER-EQL-VOP :INTERLEAVED-
:LINKAGE-TABLE :LITTLE-ENDIAN :MACH-EXCEPTION
:MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-SIMD-PACK :SB-SOURCE-
:STACK-
:STACK-
:STACK-
:UNWIND-
Changed in sbcl: | |
status: | New → Confirmed |
Changed in sbcl: | |
assignee: | nobody → Jan Moringen (scymtym) |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
interestingly enough in slime i cannot reproduce this. i keep pressing 'q' in the debugger and after a few presses it just quits back to the repl without entering LDB.
the same SBCL version in the terminal dies.