summaryrefslogtreecommitdiff
path: root/tests/fin-threadsafety.pure.lisp
diff options
context:
space:
mode:
authorDouglas Katzman <dougk@google.com>2022-04-28 21:12:08 -0400
committerDouglas Katzman <dougk@google.com>2022-04-28 21:15:51 -0400
commit6db04b68c1df38697938930e7dac8efea9042fb7 (patch)
tree1ca5c52f83d21f8d2b3bc89264986bee00835ae7 /tests/fin-threadsafety.pure.lisp
parent813250e7d7661bf5884493fe7c6a62f52ccc67ed (diff)
Correct a test
Diffstat (limited to 'tests/fin-threadsafety.pure.lisp')
-rw-r--r--tests/fin-threadsafety.pure.lisp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/fin-threadsafety.pure.lisp b/tests/fin-threadsafety.pure.lisp
index bd3752a22..52ce11e4d 100644
--- a/tests/fin-threadsafety.pure.lisp
+++ b/tests/fin-threadsafety.pure.lisp
@@ -37,12 +37,18 @@
(let ((fun (sb-kernel:%make-funcallable-instance 0))
(stop nil)
(condition nil))
- ;; It doesn't matter what this layout is, but it has to be something.
- ;; GC checks for a layout before fixing up any other slots. That's required
- ;; because immobile funcallable-instances contain raw bytes comprising the
- ;; self-contained trampoline. For some reason FUNCALLABLE-INSTANCE claims
- ;; to have a 0 bitmap which implies 0 tagged slots. I don't like that.
- (sb-kernel:%set-fun-layout fun (sb-kernel:find-layout 'function))
+ ;; If the %FUN-LLAYOUT were unset or its bitmap were 0, then the
+ ;; %FUNCALLABLE-INSTANCE-FUN slot would not be visited in GC because
+ ;; it assumes the instance is wholly empty in that case.
+ ;; It doesn't matter too much what the layout is, but it has to be something
+ ;; whose bitmap satisfies the assertion in "verify_headered_object()"
+ ;; concerning the potentially valid bitmaps for a funcallable instance.
+ ;; FUNCALLABLE-INSTANCE itself has a 0 bitmap which implies 0 tagged slots
+ ;; (which seems dubious to be sure), and FUNCTION has a bitmap indicating
+ ;; 1 raw slot and all the rest tagged. Neither of those is right.
+ ;; GENERIC-FUNCTION is ok even though this is not an instance of it.
+ ;; I _think_ this makes the test reliable with pre_verify_gen_0 enabled.
+ (sb-kernel:%set-fun-layout fun (sb-kernel:find-layout 'generic-function))
(setf (sb-kernel:%funcallable-instance-fun fun) #'closure-one)
(flet ((changer ()
(loop (sb-thread:barrier (:read))