[Sbcl-devel] failed AVER: NSLOTDS

6 views
Skip to first unread message

Alex Mizrahi

unread,
Sep 6, 2011, 11:11:49 AM9/6/11
to sbcl-...@lists.sourceforge.net
This problem (regression) when using Elephant was already reported by
Kevin Raison.
I don't know what's the current status, but I can add some details
which hopefully will help to fix this.

So this problem happens in SLOTD-CLASSES-EQ. The reason is that number
of slots is different,
oslotds = (#<ELEPHANT::TRANSIENT-EFFECTIVE-SLOT-DEFINITION ELEPHANT::OID>
#<ELEPHANT::TRANSIENT-EFFECTIVE-SLOT-DEFINITION ELEPHANT::SPEC>
#<ELEPHANT::INDEXED-EFFECTIVE-SLOT-DEFINITION NAME>
#<ELEPHANT::ASSOCIATION-EFFECTIVE-SLOT-DEFINITION JOBS>)
nslotds = (#<ELEPHANT::TRANSIENT-EFFECTIVE-SLOT-DEFINITION ELEPHANT::OID>
#<ELEPHANT::TRANSIENT-EFFECTIVE-SLOT-DEFINITION ELEPHANT::SPEC>
#<ELEPHANT::INDEXED-EFFECTIVE-SLOT-DEFINITION NAME>)

I.e. JOBS slot was dropped.

SLOTD-CLASSES-EQ is called from %UPDATE-SLOTS, particularly this piece of code:

((and (equal nlayout olayout)
(equal (mapcar #'car owrapper-class-slots)
(mapcar #'car nwrapper-class-slots))
(slotd-classes-eq (slot-value class 'slots) eslotds))
owrapper)

So it looks like that SB-MOP did not expect that number of slots might
be different at this point.

I don't understand SBCL CLOS implementation, so take it with a grain
of salt, but it seems like SBCL might be confused because JOBS (and
NAME) is a "virtual" slot which is not allocated in instance. Neither
is NAME.

So it compares nlayout and olayout which contain only instance slots
OID and SPEC:

NEW:((ELEPHANT::OID . T) (ELEPHANT::SPEC OR LIST STRING))
OLD:((ELEPHANT::OID . T) (ELEPHANT::SPEC OR LIST STRING))

And thinks that rest is same too.

HTH

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Sbcl-devel mailing list
Sbcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel

Alex Mizrahi

unread,
Sep 6, 2011, 12:11:37 PM9/6/11
to sbcl-...@lists.sourceforge.net
> SLOTD-CLASSES-EQ is called from %UPDATE-SLOTS, particularly this piece of code:
>
> ((and (equal nlayout olayout)
>                        (equal (mapcar #'car owrapper-class-slots)
>                               (mapcar #'car nwrapper-class-slots))
>                        (slotd-classes-eq (slot-value class 'slots) eslotds))
>                   owrapper)
>
> So it looks like that SB-MOP did not expect that number of slots might
> be different at this point.


I've looked some more into this, the problem is that this code assumes
that there are only instance-allocated slots and class-allocated,
while we have database-allocated ones.

Alex Mizrahi

unread,
Sep 13, 2011, 9:40:57 AM9/13/11
to sbcl-...@lists.sourceforge.net
Here'e a small test case based on 'virtual slots' example from
Lispworks (http://www.lispworks.com/documentation/lw445/LWUG/html/lwuser-155.htm)
adapted to work in SBCL:

http://paste.lisp.org/display/124638

(asdf:oos 'asdf:load-op :closer-mop)
(in-package :c2cl)
(load (compile-file "/home/alex/virtual-slot.lisp"))
(test)
(test-redinition)

It works in SBCL 1.0.16 and CCL 1.7. but not in SBCL from git. (And
from what I've heard it is broken in last 5 versions or so, WTF).

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1

Nikodemus Siivola

unread,
Sep 20, 2011, 1:51:48 PM9/20/11
to Alex Mizrahi, sbcl-...@lists.sourceforge.net
On 13 September 2011 16:40, Alex Mizrahi <alex.m...@gmail.com> wrote:

> Here'e a small test case based on 'virtual slots' example from
> Lispworks (http://www.lispworks.com/documentation/lw445/LWUG/html/lwuser-155.htm)
> adapted to work in SBCL:

Thanks for the test case! Fix committed.

Cheers,

-- Nikodemus

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1

Reply all
Reply to author
Forward
0 new messages