HDF5.jl icon indicating copy to clipboard operation
HDF5.jl copied to clipboard

Stackoverflow when assigning ascii string element-wise to a dataset

Open WojciechMigda opened this issue 10 years ago • 0 comments

I have a dataset designed to hold vector of ASCIIString s, created like this:

    varstring_dtype = HDF5Datatype(HDF5.h5t_copy(HDF5.H5T_C_S1))
    HDF5.h5t_set_size(varstring_dtype.id, HDF5.H5T_VARIABLE)
    ydset = d_create(fid, "lid/train/y", varstring_dtype, dataspace((NROWS,)))

Then, in loop I am assigning elements of the dataset:

record = 1
(...)
    ydset[record] = "foo"

Unfortunately, this causes stackoverflow:

ERROR: stack overflow
 in anonymous at C:\{HOME}\.julia\v0.3\HDF5\src\plain.jl:1624
 in ntuple at
 in setindex! at C:\{HOME}\.julia\v0.3\HDF5\src\plain.jl:1624 (repeats 15151 times)
 in main at {SCRIPT_FILENAME}:67
 in include at
 in include_from_node1 at loading.jl:128
 in process_options at
while loading {SCRIPT_FILENAME}, in expression starting on line 110

My baseline:

Version 0.3.11 (2015-07-27 06:18 UTC)
Official http://julialang.org/ release
x86_64-w64-mingw32

This is the dataset structure as seen with h5dump:

         DATASET "y" {
            DATATYPE  H5T_STRING {
               STRSIZE H5T_VARIABLE;
               STRPAD H5T_STR_NULLTERM;
               CSET H5T_CSET_ASCII;
               CTYPE H5T_C_S1;
            }
            DATASPACE  SIMPLE { ( 29 ) / ( 29 ) }
            DATA {
            (0): NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
            (10): NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
            (20): NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
            }
         }

WojciechMigda avatar Sep 24 '15 14:09 WojciechMigda