Stepping is not GC-safe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
The function which is arranged to be called by the stepper gets moved by the GC:
(defun test-step-out/2 ()
(let* ((count 0)
(step (out))))
(defun z (x)
x)
(defun in ()
(declare (optimize debug))
(z 1)
(z 2)
(z 3)
(z 4))
(defun out ()
(declare (optimize debug))
(in))
(sb-thread:
(lambda ()
(loop
(handler-bind ((step-condition #'sb-impl:
(
(sb-thread:
(lambda ()
(sb-ext:gc :full t)))
* CORRUPTION WARNING in SBCL pid 27887(tid 140736519829248):
Memory fault at (nil) (pc=(nil), sp=0x7fffc6456580)
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
debugger invoked on a SB-SYS:
#<THREAD RUNNING {10034C1653}>:
Unhandled memory fault at #x0.
Changed in sbcl: | |
assignee: | Stas Boukarev (stassats) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
It needs with-pinned-objects around the call to (setf (context-register context callee- register- offset) (get-lisp- obj-address new-callee)), since %set-context- register is a function and get-lisp- obj-address passes a fixnum representation of the function, which doesn't hold it. context is registered by fake_foreign_ function_ call, so once it's there, it's pinned down.
Will commit after the freeze.