close Warning: Can't synchronize with repository "(default)" (/project/cmucl/public_html/git/cmucl.git does not appear to be a Git repository.). Look in the Trac log for more information.

Opened 2 years ago

Closed 2 years ago

#66 closed defect (fixed)

replace on simple-strings

Reported by: heller Owned by: somebody
Priority: minor Milestone:
Component: Core Version: 2012-12
Keywords: Cc:


This code

(deftype index () `(integer 0 #.array-total-size-limit))

(defun %move-string (from start end to index)
  (declare (type simple-string from to) (type index start end index))
  (replace to from :start1 index :start2 start :end2 end))

(let ((x (make-string 35893164)))
  (%move-string x 4 4 x 35893164)

when executed with (load (compile-file "test.lisp")) produces this error:

Type-error in kernel::object-not-type-error-handler:
   -499451136 is not of type (mod 536870911)
   [Condition of type type-error]

I don't see the bug in my code, so it seems to be a bug in CMUCL. lisp-implementation-version returns "snapshot-2012-12 (20D Unicode)"

Change History (2)

comment:1 Changed 2 years ago by rtoy

It's a bug in the DEFTRANSFORM for REPLACE. It uses BIT-BASH-COPY to copy things around and BIT-BASH-COPY uses bit indices. Characters are 16 bits (for unicode builds) so the size (35893164) times 16 overflows a fixnum.

Thanks for the report.

comment:2 Changed 2 years ago by rtoy

  • Resolution set to fixed
  • Status changed from new to closed

Oops. This was fixed in commit cdf11377fbdb369d3a3810dd9bd01a8a73007255

There are still issues with very long strings; this needs to be solved in a different way.

Note: See TracTickets for help on using tickets.