The value 9483923 is not of type (MOD 1114112)

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

Bug Description

(defun bug380 ()
  (let* ((s (coerce "abAB" 'base-string))
         (lam
           `(lambda (p1)
              (declare (optimize (safety 0))
                       (type (member ,s "") p1))
              (char p1 1))))
    (funcall (compile nil lam) s)))

(bug380) ==>

The value
  9483923
is not of type
  (MOD 1114112)
   [Condition of type TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD tid=1977 "repl-thread" RUNNING {1000EE00A3}>)

Backtrace:
  0: (SB-KERNEL::MAKE-CHARACTER-SET-TYPE ((9483923 . 9483923)))
  1: (SB-KERNEL:CTYPE-OF #\U90B693)
  2: (SB-C::MAKE-CONSTANT #\U90B693) [optional]
  3: (SB-C::FIND-CONSTANT #\U90B693)
  4: (SB-C::REFERENCE-CONSTANT #<SB-C::CTRAN 1 {101010F0A3}> #<SB-C::CTRAN 2 {1010125E93}> NIL #\U90B693 NIL)
  5: (SB-C::REPLACE-COMBINATION-WITH-CONSTANT #\U90B693 #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME SB-KERNEL:DATA-VECTOR-REF-WITH-OFFSET :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :..
  6: (SB-C::CONSTANT-FOLD-CALL #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME SB-KERNEL:DATA-VECTOR-REF-WITH-OFFSET :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHERE-F..
  7: (SB-C::IR1-OPTIMIZE-COMBINATION #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME SB-KERNEL:DATA-VECTOR-REF-WITH-OFFSET :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :W..
  8: (SB-C::IR1-OPTIMIZE #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {101010AA23}> NIL)
  9: (SB-C::IR1-OPTIMIZE-UNTIL-DONE #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {101010AA23}>)
 10: (SB-C::IR1-OPTIMIZE-PHASE-1 #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {101010AA23}>)
 11: (SB-C::IR1-PHASES #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {101010AA23}>)
 12: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {101010AA23}>)
 13: (SB-C::%COMPILE (LAMBDA (P1) (DECLARE (OPTIMIZE #) (TYPE # P1)) (CHAR P1 1)) NIL NIL)
 14: ((LAMBDA NIL :IN SB-C:COMPILE-IN-LEXENV))
[...]

x86-64, "2.4.3.81-347081d26"

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

#\U90B693 is not a valid character. It looks like (at safety 0) this is reading some out of range memory location and treating it as a character.

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

Can't reproduce.

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

But I think I can make out what happens from the backtrace.

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

As noted in #sbcl, this does appear to have fixed the bug.

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.