multibyte character encoding errors hit SB-INT:BUG

Bug #713063 reported by Nikodemus Siivola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Unassigned

Bug Description

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

Test-case:

(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))

causes:

 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 <http://sbcl.sourceforge.net/>.
  [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.

Tags: unicode stream
Changed in sbcl:
status: Confirmed → In Progress
Revision history for this message
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
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

In 1.0.45.14.

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.