bugGNU Octave - Bugs: bug #35227, HDF5 h5ex_t_vlstring.h5 can't be...


bug #35227: HDF5 h5ex_t_vlstring.h5 can't be loaded

Submitter:  None
Submitted:  Tue 03 Jan 2012 02:32:54 PM UTC
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  Erich Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Fri 18 Nov 2016 08:43:40 PM UTC, comment #4: 

This will be handled by the h5read function, which will be able to read arbitrary HDF5 data files into an Octave data structure.

See patch #8607. Closing as a duplicate of that open patch, which is awaiting review to be merged into Octave.

Mike Miller <mtmiller>
Project Administrator
Thu 05 Jan 2012 10:26:10 AM UTC, comment #3: 

*)When you do not like bug call it feature

*)What could I do when I want to put an unsupported
hdf variable to octave? 

*)At least the h5ex_t_string.h5 should either load
correctly or an warning that a dataset could not
load should be presented.


Thu 05 Jan 2012 05:25:21 AM UTC, comment #2: 

Octave's load command is supposed to be able to load HDF files saved by Octave's save command.  It was not designed to load arbitrary HDF files.  So unless your example file was created by Octave using save --hdf5, I'm not sure I would consider this to be a bug.

John W. Eaton <jwe>
Project Administrator
Wed 04 Jan 2012 05:01:01 PM UTC, comment #1: 

Confirmed on a recent development tip (14146:2f05228cb959).

In terms of debugging.  It is probably easiest to start with the fixed length example.  The lack of a last column is probably an off-by-1 error where someone forgot that the length of a C string needs to be one larger than the actual string to account for the null ('\0') at the end.

I'm attaching two files from the reference website to make things easier.

File               Description
h5ex_t_string.h5   String example in HDF5 format
h5ex_t_string.tst  The expected output for the example

(file #24738, file #24739)

Rik <rik5>
Project Administrator
Tue 03 Jan 2012 02:32:54 PM UTC, original submission:  

I am very interested in loading
variable string arrays in octave,
but loading h5ex_t_vlstring.h5


fails withs

load h5ex_t_vlstring.h5
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0:
  #000: /home/hdftest/snapshots-bin-hdf5_1_8_8/current/src/H5Dio.c line 174 in H5Dread(): can't read data
    major: Dataset
    minor: Read failed
  #001: /home/hdftest/snapshots-bin-hdf5_1_8_8/current/src/H5Dio.c line 337 in H5D_read(): unable to set up type info
    major: Dataset
    minor: Unable to initialize object

the error message is in reality much longer.
The file consists of

HDF5 "h5ex_t_vlstring.h5" {
GROUP "/" {
   DATASET "DS1" {
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
      DATASPACE  SIMPLE { ( 4 ) / ( 4 ) }
      DATA {
      (0): "Parting", "is such", "sweet", "sorrow."

What can I do to load a h5 file with a vector of
variable length strings.

I want to load a vector of 300 000 strings most of fixed
length butfixed length is not guaranteed.

Which types of HDF5-strings are allowed are supported in octave?
 at least

load h5ex_t_string.h5

produces  DS1
DS1 =

is suc

+verbatim+>> s=hdf5read('/home/erich/down/h5ex_t_vlstring.h5','DS1')
hdf5.h5string: 4-by-1

>> s(1).Data


>> s(2).Data

ans =
is such

>> s(3).Data

ans =

>> s(4).Data

ans =

this is also not completly correct! the last column is lost.
See the output from Matlab

Ciau Erich



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

Attach Files:

Attached Files
file #24738:  h5ex_t_string.h5 added by rik5 (2KiB - application/octet-stream)
file #24739:  h5ex_t_string.tst added by rik5 (159B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Updated 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-18 mtmiller StatusConfirmed Duplicate
        Open/ClosedOpen Closed
    2013-10-10 rik5 Item GroupSegfault, Bus Error, etc. Incorrect Result
    2012-01-04 rik5 Attached File- Added h5ex_t_string.h5, #24738
        Attached File- Added h5ex_t_string.tst, #24739
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.10