bugGNU Octave - Bugs: bug #48673, add_hdf5_data fails for structs

 
 

bug #48673: add_hdf5_data fails for structs

Submitter:  Dmitry Messerman <mdmitry>
Submitted:  Mon 01 Aug 2016 01:29:09 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Dmitry Messerman Open/Closed:  * Closed
Release:  * 4.0.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Mar 2019 01:31:38 AM UTC, comment #1: 

In current versions of Octave, it is possible to save scalar struct values HDF5 format files with the -hdf5 option (LS_HDF5).

Moreover, in Octave 5.1 the 'write_header', 'do_save', and other functions relating to loading and saving Octave data are no longer part of the public API. There has been some discussion on the maintainers mailing list about making them public again, but the safest approach is to embed an interpreter and call the load and save functions through the interpreter.

Since this isn't reproducible as posted, I'm closing this as invalid, but please do feel free to comment or report another bug if you still run into issues in a current version of Octave.

Mike Miller <mtmiller>
Group Member
Mon 01 Aug 2016 01:29:09 PM UTC, original submission:  

The following code:

#include <octave/oct.h>
#include <octave/load-save.h>
#include <octave/oct-map.h>
#include <octave/ls-hdf5.h>

using namespace std;

typedef symbol_table::symbol_record OctaveSymbolRecord;

int main() {
    auto my_map = octave_map();
    my_map.setfield(string("mykey"),octave_value(0));
    hdf5_ofstream ofs("octave_bug.hdf5");
    write_header(ofs, LS_HDF5);
    do_save(ofs, OctaveSymbolRecord(0, "my_map", octave_value(my_map)), LS_HDF5, false);
    return 0;
}

Fails with the following error message:

error: full: invalid operation for %s type: wrong type argument 'scalar struct'
error: octave_base_value::save_binary(): wrong type argument '<unknown type>'
error: save: error while writing 'my_map' to hdf5 file


Dmitry Messerman <mdmitry>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mdmitry (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-04 mtmiller StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code