Incorrect code bug w. DYNAMIC-EXTENT, PROGV

Bug #1739652 reported by Paul F. Dietz on 2017-12-21
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alastair Bridgewater

Bug Description

(declaim (special *s*))

(defun f57 ()
  (let ((v (list (list :good)
                 (progv '(*s*) (list :bad) *s*))))
    (declare (dynamic-extent v))
    (caar v)))

(f57) ==> :BAD

This occurs wih high probability in a new dynamic-extent random tester I wrote. Some of the failures cause memory faults instead of wrong results.

description: updated
description: updated
description: updated
Stas Boukarev (stassats) wrote :

Reduced to:

(defun f57 ()
  (declare (optimize (debug 1)))
  (let ((v (list (list :good)
                 (labels ((r (x)
                            (cond (x)
                                   (r 33)))))
                   (r nil)))))
    (declare (dynamic-extent v))
    (caar v)))

BACK-PROPAGATE-ONE-DX-LVAR isn't back-propagating correctly because this test case includes a loop consisting of more than one block, thus triggering the "duplicate edge in path" case for the pathwise back-propagation, which is there to keep the compiler from going into an infinite loop.

tags: added: dynamic-extent stack-analysis
Changed in sbcl:
assignee: nobody → Alastair Bridgewater (alastair-bridgewater)
status: New → In Progress
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers