bugGNU Octave - Bugs: bug #45694, missing octave_java::save_binary...

 
 

bug #45694: missing octave_java::save_binary or save_ascii

Submitted by:  CarnĂ« Draug <carandraug>
Submitted on:  Tue 04 Aug 2015 04:59:40 PM UTC
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Fri 14 Aug 2015 05:06:30 AM UTC, comment #3: 

I checked in a changeset that emits a warning when someone attempts to save a java object, but otherwise continues so that other variables can still be saved (as in the case of a crash and an immediate save to octave-workspace).  See http://hg.savannah.gnu.org/hgweb/octave/rev/b22528fd3deb.  Closing this report since it is a duplicate of bug #42112.

Rik <rik5>
Project Administrator
Tue 04 Aug 2015 06:19:05 PM UTC, comment #2: 

Maybe for the time being the best thing to do is to just have the routine issue a warning message and skip writing the particular java object to the file.

The code to modify is in interpreter/octave-value.

All of the octave-value types inherit a default save_binary from ov.h.  But, generally this is overridden by the specific octave-value type.  For an example, take a look at ov-range.h and ov-range.cc and search for save_binary.  It would easy to provide prototypes for save_binary, save_ascii in ov-java.h.  The implementations of those functions in ov-java.cc would simply issue a warning and then "return true;" to allow Octave to continue saving other variables.

Rik <rik5>
Project Administrator
Tue 04 Aug 2015 06:11:28 PM UTC, comment #1: 

Confirmed.  This has been known for a while.  It might be possible to write something based on the Serialize methods of Java.  See my comment #5 in bug #42112.

Rik <rik5>
Project Administrator
Tue 04 Aug 2015 04:59:40 PM UTC, original submission:  

I came across this issue during an Octave crash, when Octave tried to save a java object into the octave-workspace:

attempting to save variables to 'octave-workspace'...
error: octave_base_value::save_binary(): wrong type argument 'octave_java'
error: called from
    dev/scripts/imaging/nna at line 147 column 9
save to 'octave-workspace' complete
octave exited with signal 11

It also happens when using save:

octave-gui:2> x = javaObject ("java.lang.StringBuffer", "Initial string");
octave-gui:3> save foo.mat x
error: octave_base_value::save_ascii(): wrong type argument 'octave_java'
warning: save: no such variable 'x'

Which does make sense, but maybe a better error message could be done.

Carnë Draug <carandraug>
Project Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by carandraug (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 project members can vote.

     

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-14 rik5 Open/ClosedOpen => Closed
    2015-08-04 rik5 Dependencies- => Depends on bugs #42112
    2015-08-04 rik5 StatusNone => Duplicate

    Back to the top


    Powered by Savane 3.9