Losing finalizers
Bug #2029306 reported by
Stas Boukarev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Douglas Katzman |
Bug Description
(defvar *x*)
(defun clear-registers (&optional a b c d e f g h i j k l m n o p q)
(values q p o n m l k j i h g f e d c b a))
(defun test ()
(setf *x* (make-hash-table))
(clear-registers)
(sb-ext:finalize *x* (lambda () (error "final")) :dont-save t)
(clear-registers)
(sb-sys:
(assert (sb-ext:
(sb-thread:
(loop repeat 1
do
(
Quickly fails the assertion, both x86-64 and arm64.
Changed in sbcl: | |
assignee: | nobody → Douglas Katzman (dougk) |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I suspect this a race between the user thread trying to cancel, and the finalizer thread which, in addition executing finalizers, has the responsibility of re-hashing the table when a key moves. So it only appears to lose finalizers in this slightly unusual case, but yeah it needs to be fixed. As support for my theory, introducing the tiniest bit of delay before cancel-finalization seems to make it not fail