multibyte character encoding errors hit SB-INT:BUG

Bug #713063 reported by Nikodemus Siivola on 2011-02-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Reported by Jianshi Huang on sbcl-bugs for EUC-JP.


(with-open-file (f "/tmp/foo"
                   :direction :output
                   :external-format :euc-jp
                   :if-exists :supersede)
  (write-string (make-string 1 :initial-element #\horizontal_bar) f))


 can't happen
This is probably a bug in SBCL itself. (Alternatively, SBCL
might have been corrupted by bad user code, e.g. by an undefined
Lisp operation like (FMAKUNBOUND 'COMPILE), or by stray pointers
from alien code or from unsafe Lisp code; or there might be a
bug in the OS or hardware that SBCL is running on.) If it seems
to be a bug in SBCL itself, the maintainers would like to know
about it. Bug reports are welcome on the SBCL mailing lists,
which you can find at <>.
  [Condition of type SB-INT:BUG]

The issue appears to be that if there is no representation for the character,

         (mb-char-len (or (,ucs-to-mb (char-code byte)) -1))

at line 259 in mb-util.lisp calls MB-CHAR-LEN with -1, which it isn't prepared to handle.

Changed in sbcl:
status: Confirmed → In Progress
Nikodemus Siivola (nikodemus) wrote :

Attached patch fixes this, but I cannot commit it right now due to Sourceforge SSH problems.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
tags: added: pending
Nikodemus Siivola (nikodemus) wrote :


Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
tags: removed: pending
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers