Memory fault on printing dead restart

Bug #1840048 reported by Wilfredo Velázquez-Rodríguez on 2019-08-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

1. Printing an out-of-extent restart seems to cause a memory fault:

;;; Begin
(defun restart-test ()
  (print (restart-case (find-restart 'foo)
           (foo ()))))

* (restart-test)

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

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.

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

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.

(SB-KERNEL:OUTPUT-UGLY-OBJECT #<BROADCAST-STREAM {1000616033}> #<error printing object>)
0[2]
;;; end

2. λ sbcl --version
SBCL 1.5.4

3. uname -a
MSYS_NT-10.0 catalyst 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys

4. * *features*
(:X86-64 :64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :AVX2
 :C-STACK-IS-CONTROL-STACK :CALL-SYMBOL :COMMON-LISP :COMPARE-AND-SWAP-VOPS
 :CYCLE-COUNTER :FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT
 :INTEGER-EQL-VOP :LINKAGE-TABLE :LITTLE-ENDIAN :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-PUTWC :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-DOC
 :SB-DYNAMIC-CORE :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-QSHOW
 :SB-SAFEPOINT :SB-SAFEPOINT-STRICTLY :SB-SIMD-PACK :SB-SIMD-PACK-256
 :SB-SOURCE-LOCATIONS :SB-THREAD :SB-THRUPTION :SB-UNICODE :SB-WTIMER
 :SB-XREF-FOR-INTERNALS :SBCL :STACK-ALLOCATABLE-CLOSURES
 :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :UNDEFINED-FUN-RESTARTS :UNWIND-TO-FRAME-AND-CALL-VOP :WIN32)

Issue seems to be reproducible on other platforms.

Note that printing the restart while it's still alive works fine.

Stas Boukarev (stassats) wrote :

Yes, they are dynamic-extent allocated.

Changed in sbcl:
status: New → Invalid

Right, that's why I made it clear that it's only out-of-extent restarts that behave like this. The reason I brought up this issue is because it seemed odd to me for the printing (not invoking) to memory fault, rather than eg #<RESTART FOO(dead)>

Stas Boukarev (stassats) wrote :

You're printing dead memory, it's no longer a restart or anything.

Understood. Thank you.
Sorry for the duplicate.

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

Other bug subscribers