failure to detect out of extent exit from GO

Bug #1023713 reported by 3b
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Medium
Unassigned

Bug Description

;;; at SAFETY < 3
(defun a ()
  (declare (optimize speed))
  (block nil
    (tagbody
       (flet ((b () (go :c)))
         (return (lambda () (b))))
     :c)))

(funcall (a))

causes

 CORRUPTION WARNING in SBCL pid 14074(tid 140737353905920):
Memory fault at 0 (pc=0x100403ea6b, sp=0x7ffff66df560)
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
CORRUPTION WARNING in SBCL pid 14074(tid 140737353905920):
Memory fault at 79 (pc=0x2000012f, sp=0x7ffff66d89f0)
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
fatal error encountered in SBCL pid 14074(tid 140737353905920):
%PRIMITIVE HALT called; the party is over.

and drops into LDB in SBCL 1.0.57.55-80ad081 on X8664 linux.

Calling GO directly in the LAMBDA, or returning #'b instead of the LAMBDA both properly detect the problem, producing the note

; note: Allocating a value-cell at runtime for checking possibly out of extent exit via
; (GO :C). Use GO/RETURN-FROM with SAFETY 0, or declare the exit function
; DYNAMIC-EXTENT to avoid.

during compilation, and invoking the debugger as expected.

At SAFETY 3, it catches the error as expected.

1.0.36 x86 linux and 1.0.55.14 x8664 linux invoke the debugger as expected for all 3 cases at default SAFETY, with no optimization notes.

Stas Boukarev (stassats)
Changed in sbcl:
importance: Undecided → Medium
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

still happens on 1.3.8.46

may be related to https://bugs.launchpad.net/sbcl/+bug/1035634

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.