bugGNU Octave - Bugs: bug #53786, crash with textscan on UTF-16 text...


bug #53786: crash with textscan on UTF-16 text file with BOM

Submitter:  Hartmut <hardy>
Submitted:  Sun 29 Apr 2018 06:03:32 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Mon 04 Jun 2018 07:10:50 PM UTC, comment #6: 

I grafted the changeset to stable here:

Markus Mützel <mmuetzel>
Group administrator
Mon 04 Jun 2018 11:55:13 AM UTC, comment #5: 

Thanks for this patch, Markus. And sorry, I wasn't succesful in testing this (because the default branch currently doesn't compile on my qt4 Ubuntu 16.04 system).

But one remark and wish @Markus : Your patch is currently only applied to the default branch. Wouldn't it be good to also apply it the the STABLE branch? It resolves a crash, and only changes one single line of code (=small risk to make things worse).

Hartmut <hardy>
Sun 03 Jun 2018 07:40:18 PM UTC, comment #4: 

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Sat 02 Jun 2018 04:31:14 PM UTC, comment #3: 

I pushed a changeset here:

Even if it doesn't fix all issues with reading UTF-16 encoded files, it at least avoids the segfault.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sun 06 May 2018 05:27:14 PM UTC, comment #2: 

Confirmed eith Ovave 4.4.0 pn Win-7.
But it also crash in 4.2.2, so for me it is not a regression

Avinoam Kalma <avinoam>
Group Member
Mon 30 Apr 2018 02:26:00 PM UTC, comment #1: 

Confirmed with dev version (5.0.0) on Windows 7

Philip Nienhuis <philipnienhuis>
Group Member
Sun 29 Apr 2018 06:03:32 PM UTC, original submission:  

Here is a reproducible way to generate a CRASH with Octave 4.3.92 under linux as well as under Windows:

  • Download the appended text file. I just contains an example text with the three letters abc. The text encoding (generated with Geany) is "UTF 16 BE with BOM", some other text editor called this "ucs big endian".
  • run the following easy code to import this text file with the textscan function:

filename ='text_ucs-big.csv'
a_textscan = textscan(fid,'%s');

This still worked fine with Octave 4.2.1 (i.e. no crash). So this is a regression.

I don't know if the chosen text encoding is the only one to produce a crash. I testes around 5 different text encodings (for a different bug report), and those worked fine.

Hartmut <hardy>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #44059:  text_ucs-big.csv added by hardy (12B - text/csv)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by hardy (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-03 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-06-02 mmuetzel StatusConfirmed Ready For Test
    2018-05-01 mtmiller Summarycrash with textscan (and special text encoding) crash with textscan on UTF-16 text file with BOM
    2018-04-30 philipnienhuis StatusNone Confirmed
        Release4.3.92 dev
    2018-04-29 hardy Attached File- Added text_ucs-big.csv, #44059

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code