internal error externalizing recursive array

Bug #2038233 reported by James Kalenius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Committed
Undecided
Unassigned

Bug Description

Was doing some fuzz testing and came up with this little monstrosity. If you stick it in a file and COMPILE-FILE it, it trips an internal type error during FASL dump.

(defparameter *death*
  '#.(let ((a1 #1=#2a((#1# #1#) (#1# #1#))))
       (make-array 2 :displaced-to a1)))

Expected behavior would of course be that it compiles fine, and the result loads as something similar.

This happens on SBCL 2.2.9.debian, as well as 2.3.9.33-1742bcc35 that I just built from git.

uname -a: Linux zeus 6.1.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.8-1 (2023-01-29) x86_64 GNU/Linux

*features*: (:ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE :SBCL :UNIX)

Session with backtrace:

This is SBCL 2.3.9.33-1742bcc35, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (compile-file "/tmp/death.lisp")
; compiling file "/tmp/death.lisp" (written 02 OCT 2023 03:56:41 PM):

debugger invoked on a TYPE-ERROR @52AB53F3 in thread
#<THREAD tid=2291692 "main thread" RUNNING {1004490113}>:
  The value
    NIL
  is not of type
    (UNSIGNED-BYTE 32)
  when binding SB-C::VALUE

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-C:WRITE-VAR-INTEGER NIL #()) [external]
0] backtrace

Backtrace for: #<SB-THREAD:THREAD tid=2291692 "main thread" RUNNING {1004490113}>
0: (SB-C:WRITE-VAR-INTEGER NIL #()) [external]
1: (SB-FASL::DUMP-VARINT NIL #<SB-FASL:FASL-OUTPUT "/tmp/death.fasl">)
2: (SB-FASL::DUMP-CIRCULARITIES (#S(SB-FASL::CIRCULARITY :TYPE :SVSET :OBJECT #(#1=#2A((#1# #1#) (#1# #1#)) #1#) :INDEX 1 :SLOT-NAME NIL :VALUE #1# :ENCLOSING-OBJECT #1#) #S(SB-FASL::CIRCULARITY :TYPE :SVSET :OBJECT #2=#(#1# #1# #1# #1#) :INDEX 3 :SLOT-NAME NIL :VALUE #1# :ENCLOSING-OBJECT #1#) #S(SB-FASL::CIRCULARITY :TYPE :SVSET :OBJECT #2# :INDEX 2 :SLOT-NAME NIL :VALUE #1# :ENCLOSING-OBJECT #1#) #S(SB-FASL::CIRCULARITY :TYPE :SVSET :OBJECT #2# :INDEX 1 :SLOT-NAME NIL :VALUE #1# :ENCLOSING-OBJECT #1#) #S(SB-FASL::CIRCULARITY :TYPE :SVSET :OBJECT #2# :INDEX 0 :SLOT-NAME NIL :VALUE #1# :ENCLOSING-OBJECT #1#)) #<SB-FASL:FASL-OUTPUT "/tmp/death.fasl">)
3: (SB-FASL:DUMP-OBJECT #(#1=#2A((#1# #1#) (#1# #1#)) #1#) #<SB-FASL:FASL-OUTPUT "/tmp/death.fasl">)
4: (SB-FASL::DUMP-CODE-OBJECT #<SB-C:COMPONENT :NAME "top level form" {1002858E23}> #<SB-ASSEM:SEGMENT {1002861D43}> 112 (#S(SB-C::FIXUP-NOTE :KIND :ABS32 :FIXUP #S(SB-C:FIXUP :NAME SB-IMPL::%DEFPARAMETER :FLAVOR :FDEFN-CALL :OFFSET 0) :POSITION 85)) NIL #<SB-FASL:FASL-OUTPUT "/tmp/death.fasl">)
5: (SB-FASL:FASL-DUMP-COMPONENT #<SB-C:COMPONENT :NAME "top level form" {1002858E23}> #<SB-ASSEM:SEGMENT {1002861D43}> 112 (#S(SB-C::FIXUP-NOTE :KIND :ABS32 :FIXUP #S(SB-C:FIXUP :NAME SB-IMPL::%DEFPARAMETER :FLAVOR :FDEFN-CALL :OFFSET 0) :POSITION 85)) NIL #<SB-FASL:FASL-OUTPUT "/tmp/death.fasl">)
6: (SB-C::%COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "top level form" {1002858E23}>)
7: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "top level form" {1002858E23}>)
8: (SB-C::SUB-COMPILE-TOPLEVEL-LAMBDAS NIL T)
9: (SB-C::COMPILE-TOPLEVEL-LAMBDAS NIL T)
10: ((LAMBDA NIL :IN SB-C::SUB-COMPILE-FILE))
11: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
12: (SB-C::SUB-COMPILE-FILE #<SB-C::SOURCE-INFO {10027F7C43}> NIL)
13: (COMPILE-FILE "/tmp/death.lisp" :OUTPUT-FILE "" :VERBOSE NIL :PRINT NIL :EXTERNAL-FORMAT :DEFAULT :PROGRESS NIL :TRACE-FILE NIL :BLOCK-COMPILE NIL :ENTRY-POINTS NIL :EMIT-CFASL NIL)
14: (SB-INT:SIMPLE-EVAL-IN-LEXENV (COMPILE-FILE "/tmp/death.lisp") #<NULL-LEXENV>)
15: (EVAL (COMPILE-FILE "/tmp/death.lisp"))
16: (INTERACTIVE-EVAL (COMPILE-FILE "/tmp/death.lisp") :EVAL NIL)
17: (SB-IMPL::REPL-FUN NIL)
18: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
19: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<FUNCTION (LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL) {7F73ACCB7C1B}>)
20: (SB-IMPL::TOPLEVEL-REPL NIL)
21: (SB-IMPL::TOPLEVEL-INIT)
22: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
23: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
24: (SB-IMPL::%START-LISP)

0]

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