bugGNU Octave - Bugs: bug #40980, Failure to load uint8 variables...

 
 

bug #40980: Failure to load uint8 variables from text files

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Fri 20 Dec 2013 01:04:04 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  jordigh
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 11 Jan 2014 12:27:17 AM UTC, comment #3: 

I have pushed a slightly modified version of the patch here:

http://hg.savannah.gnu.org/hgweb/octave/rev/284e5c87f27b

This should soon become part of Octave 3.8.1

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Mon 23 Dec 2013 10:31:34 AM UTC, comment #2: 

Thanks, Jordi, I tried the patch with RC2 and it works fine for the cases that I tested.

Since your patch changes the internal representation of variables in the saved text files, it can break in situations where the old behavior was expected.  For instance, people that saved uint8 variables in text files in the past would be unable to read their files now.  These should be corner cases, but a fallback solution could be provided for them.

Rafael Laboissière <rlaboiss>
Sat 21 Dec 2013 11:58:57 PM UTC, comment #1: 

I attach a proposed fix for this problem.

I'm not sure if this fix should go into the impending release, though. I think it's safe, but I am not sure.

(file #30061)

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Fri 20 Dec 2013 01:04:04 PM UTC, original submission:  

The bug report reproduced below was submitted against the Debian package octave_3.6.4-4.  This bug is also present in version 3.8.0-rc1.  The URL of the bug report is http://bugs.debian.org/732659

-- Forwarded message from Kacper Gutowski <mwgamera@gmail.com> [2013-12-20 04:28]:
 
When a variable of class uint8 is saved in the default text format, it's actually written out in binary (one byte per element) instead of plain text like every other type.  I don't know whether this is intended or not, but file containing such variable can be loaded only if said variable had no elements of values 9, 10, 11, 12, 13, or 32.  These correspond to white characters in ASCII and apparently "load" gets confused by them.

Minimal example to reproduce the problem:


octave -q --no-init-file
octave:1> a = uint8(10);
octave:2> save 'a' a
octave:3> load 'a'
error: load: failed to load scalar constant
error: load: trouble reading ascii file 'a'
error: load: reading file a


Rafael Laboissière <rlaboiss>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30061:  40980.diff added by jordigh (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by rlaboiss (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-11 jordigh StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-12-21 jordigh Attached File- Added 40980.diff, #30061
        StatusNone Patch Submitted
        Assigned toNone jordigh

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code