[Sbcl-devel] Bug in the CLOS MOP...

Hi,
I have gotten a bug report from a ContextL user, and I have been able
to trace it down to a bug in the CLOS MOP implementation of SBCL (I
think, but I'm pretty sure).
I will put some work into creating a test case that doesn't require
ContextL, but just SBCL, but at the moment it's fastest for me to post
the test case that uses ContextL. Maybe this is already helpful for
someone to fix the bug.
Here is the code:
(asdf:oos 'asdf:load-op :contextl)
(defpackage "context" (:use :cl :contextl))
(in-package "context")
(define-layered-class person ()
((name :initarg :name :accessor person-name)))
(deflayer employment-layer)
(define-layered-class employer
:in-layer employment-layer ()
((name :initarg :name
:layered-accessor employer-name)))
(define-layered-class person
:in-layer employment-layer ()
((employer :initarg :employer
:layered-accessor person-employer)))
This will create an error telling us that the class precedence list
for the class person cannot be created.
However, the real bug is this: In the initialize-instance method
specialized on special-class in ContextL, there is a check whether any
of the direct superclasses is a subtype of special-object. If you
remove the call to ignore-errors there, you will get an error that
tells us that at least one of the class metaobjects from the list of
direct superclasses is not a valid type specifier. So there seems to
be something wrong with registering class metaobjects with the type
system (or something).
It also seems to be the case that the direct superclasses are not
finalized yet and don't have a class precedence list themselves.
However, that shouldn't prevent them from being types that you can
compare with subtypep - you don't need the class precedence list for
implementing a correct subtypep!
I hope I have time to create a better bug report soon...
Pascal
--
1st European Lisp Symposium (ELS'08)
http://prog.vub.ac.be/~pcostanza/els08/
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium

Thread view

Hi,
I have gotten a bug report from a ContextL user, and I have been able
to trace it down to a bug in the CLOS MOP implementation of SBCL (I
think, but I'm pretty sure).
I will put some work into creating a test case that doesn't require
ContextL, but just SBCL, but at the moment it's fastest for me to post
the test case that uses ContextL. Maybe this is already helpful for
someone to fix the bug.
Here is the code:
(asdf:oos 'asdf:load-op :contextl)
(defpackage "context" (:use :cl :contextl))
(in-package "context")
(define-layered-class person ()
((name :initarg :name :accessor person-name)))
(deflayer employment-layer)
(define-layered-class employer
:in-layer employment-layer ()
((name :initarg :name
:layered-accessor employer-name)))
(define-layered-class person
:in-layer employment-layer ()
((employer :initarg :employer
:layered-accessor person-employer)))
This will create an error telling us that the class precedence list
for the class person cannot be created.
However, the real bug is this: In the initialize-instance method
specialized on special-class in ContextL, there is a check whether any
of the direct superclasses is a subtype of special-object. If you
remove the call to ignore-errors there, you will get an error that
tells us that at least one of the class metaobjects from the list of
direct superclasses is not a valid type specifier. So there seems to
be something wrong with registering class metaobjects with the type
system (or something).
It also seems to be the case that the direct superclasses are not
finalized yet and don't have a class precedence list themselves.
However, that shouldn't prevent them from being types that you can
compare with subtypep - you don't need the class precedence list for
implementing a correct subtypep!
I hope I have time to create a better bug report soon...
Pascal
--
1st European Lisp Symposium (ELS'08)
http://prog.vub.ac.be/~pcostanza/els08/
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium

Pascal Costanza <pc@...> writes:
> Hm, has this bug report been noted? I want to make sure that this
> doesn't go unnoticed, so a quick ack would be nice.
I've tagged it, but on the other hand I have tagged about 900 messages
in sbcl-devel, some dating from 2003 or so, so...
(rapid question: could you simply be missing a finalize-inheritance
somewhere?)
Cheers,
Christophe

On 1/28/08, Christophe Rhodes <csr21@...> wrote:
> Pascal Costanza <pc@...> writes:
>
> > Hm, has this bug report been noted? I want to make sure that this
> > doesn't go unnoticed, so a quick ack would be nice.
>
> I've tagged it, but on the other hand I have tagged about 900 messages
> in sbcl-devel, some dating from 2003 or so, so...
Ditto -- though my backlog isn't quite as impressive. :)
Cheers,
-- Nikodemus