Memory fault in code recovering from control stack exhaustion

Bug #1836228 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

Load this file:

(in-package :cl-user)

;;; Test code for the control stack

(declaim (notinline foo))
(defun foo (a s)
  (let ((x (make-sequence 'list s :initial-element nil)))
    (foo x s))
  a)

(defun cs-test (s)
  (handler-case
      (foo nil s)
    (sb-kernel::control-stack-exhausted () nil)))

(defun cs (s)
  (loop for i from 1
     do (format t "~a~%" i)
     do (cs-test s)))

Then:

(cs 6) ==> eventually fails with

[...]
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
CORRUPTION WARNING in SBCL pid 31635(tid 0x7f2e28ef0b80):
Memory fault at (nil) (pc=0x43e611, fp=0x7f2e270303c0, sp=0x7f2e27030000) tid 0x7f2e28ef0b80
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
INFO: Control stack guard page reprotected

debugger invoked on a SB-SYS:MEMORY-FAULT-ERROR in thread
#<THREAD "main thread" RUNNING {10005305B3}>:
  Unhandled memory fault at #x0.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

("bogus stack frame")
0] 0

For other values of 6, the image may just hang and have to be killed.

Revision history for this message
Stas Boukarev (stassats) wrote :

6a89ad84d5de6c58ad88204a0b433439fb054d9e

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
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.