non-abortable call stack exhaustion on recursive class

Bug #1418883 reported by Lucien Pullen on 2015-02-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Jan Moringen

Bug Description

When defining a class that has itself in the class precedence list, the call stack is exhausted in SB-PCL::UPDATE-CLASS. This exhaustion is non-abortable... calling the ABORT restart results in the error appearing again, and eventually a memory corruption warning. This is present for both immediate parent classes and parent classes of parent classes.

The most simple test case is here:

* (defclass my-class (my-class) ())
* (defclass my-class (my-class) ())
; error ad nauseum

A more reasonable test case is here:

* (defclass foo (bar) ())
* (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:ENSURE-CLASS(-USING-CLASS).

version := sbcl-1.2.8-16-gc12b725

uname -a := Darwin lucien-laptoop 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64


Attila Lendvai (attila-lendvai) wrote :

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.

Stas Boukarev (stassats) on 2015-02-07
Changed in sbcl:
status: New → Confirmed
Jan Moringen (scymtym) on 2015-02-07
Changed in sbcl:
assignee: nobody → Jan Moringen (scymtym)
Jan Moringen (scymtym) on 2015-02-09
Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers