regression: hu.dwim.computed-class breaks somewhere between 1.0.46.2 and 1.0.46.24
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
High
|
Unassigned |
Bug Description
CL-USER> (lisp-implement
"1.0.46"
CL-USER> (asdf:load-system :hu.dwim.
CL-USER> (hu.dwim.
...
T
#<test-run: 1 test, 3 assertions, 0 failures in 0.0 sec>
CL-USER>
=======
CL-USER> (lisp-implement
"1.0.47"
CL-USER> (asdf:load-system :hu.dwim.
CL-USER> (hu.dwim.
ends up in this error:
Argument X is not a NUMBER:
#<SBCL-
{1002A36751}> / <#SLOT-A :pulse -1 :value NIL :kind OBJECT-SLOT>
what you see there is the underlying 'cell' object stored in the slot. it should never be returned by a computed-class accessor, so i suspect the real problem is that our svuc customization doesn't get called.
i'll try to come up with a reduced test case, but don't hold your breadth.
it's bisected by Tomas Hlavaty (many thanks!) to some extent: up to 1.0.46.2 it works, but 1.0.46.24 fails.
tags: | added: pcl |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
fyi, this test was added to our library way back in 2006:
http:// dwim.hu/ darcsweb/ darcsweb. cgi?r=HEAD% 20hu.dwim. computed- class;a= filediff; h=2006102617052 2-e3083- 595df2a80698f8d 7c703707889885e 856d224d18. gz;f=test. lisp
judging from the test code, class redefinition plays a key role in this. the erasure of the comments you can find in the original version inlined below suggests that the bug has been fixed in sbcl at some point.
+;; TODO: send a bug report to SBCL's list class/compute/ 3 cache-computed- test) nil) cache-computed- test () cache-computed- test :slot-a (compute-as 1) :slot-b 1))) cache-computed- test () cache-computed- test using-class probably because of some accessor method cache? using-class probably because of some accessor method cache?
+(test computed-
+ (setf (find-class 'sbcl-class-
+ (defclass sbcl-class-
+ ((slot-a :accessor slot-a-of :initarg :slot-a)
+ (slot-b :accessor slot-b-of :initarg :slot-b))
+ (:metaclass computed-class))
+ (let ((object (make-instance 'sbcl-class-
+ (slot-a-of object)
+ (slot-b-of object))
+ (defclass sbcl-class-
+ ((slot-a :accessor slot-a-of :initarg :slot-a :computed #t)
+ (slot-b :accessor slot-b-of :initarg :slot-b :computed #t))
+ (:metaclass computed-class))
+ (let ((object (make-instance 'sbcl-class-
+ :slot-a (compute-as 1)
+ :slot-b (compute-as (1+ (slot-a-of self))))))
+ (is (= 1 (slot-a-of object)))
+ ;; the next call does not call slot-value-
+ (is (= 2 (slot-b-of object)))
+ (setf (slot-a-of object) 2)
+ ;; the next call does not call slot-value-
+ ;; even slot-value does not call svuc?!
+ (is (= 3 (slot-b-of object)))))