HDFview cannot handle symbols in names

Hi all,
I'm having some difficulty with HDFview when names (e.g. dataset
names/compound member names) contain standard symbols (e.g. degrees °).
HDF5 itself works fine, but unexpected behaviour is observed in HDFview
(seen in both 2.9 and 2.10) - such objects cannot be opened or queried.

In the simplest example, I've created a dataset that cannot be opened in
HDFview (double clicking the name has no effect), and choosing "Show
Properties" on the dataset results in a
java.lang.reflect.InvocationTargetException. Interestingly the last
character of the dataset name is culled; which is potentially why there is
an error.

The same dataset can be opened and queried in C as follows:

#include <hdf5.h>
#include <stdio.h>
int main()
{
char S[32];
hid_t f = H5Fopen( "test-symb.h5", H5P_DEFAULT,H5P_DEFAULT );
H5Lget_name_by_idx( f, ".", H5_INDEX_NAME, H5_ITER_DEC, 0, S, 32,
H5P_DEFAULT );
H5Fclose( f );
puts( S );
}

Although some terminals have trouble with symbols, piping the output to a
file shows the expected result "T (°C)"

Any ideas on why HDFview seems to have problems with it?

Merry Christmas all!

Cheers,
Martijn

test-symb.h5 (1.79 KB)

Hi Martijn,

I can reproduce "truncated" name with HDFView - ")" is missing, but I am not getting an exception with 2.10 on OS X 10.8.5. Which system are you using?

h5dump produces correct result:
HDF5 "test-symb.h5" {
GROUP "/" {
   GROUP "T (°C)" {
   }
}
}
HDFView output is attached.

I will enter a bug report to fix the name in HDFView, but we will need to reproduce the exception you are getting.

Thank you!

Elena

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Dec 23, 2013, at 6:47 PM, Martijn Jasperse <m.jasperse@gmail.com> wrote:

Hi all,
I'm having some difficulty with HDFview when names (e.g. dataset names/compound member names) contain standard symbols (e.g. degrees °). HDF5 itself works fine, but unexpected behaviour is observed in HDFview (seen in both 2.9 and 2.10) - such objects cannot be opened or queried.

In the simplest example, I've created a dataset that cannot be opened in HDFview (double clicking the name has no effect), and choosing "Show Properties" on the dataset results in a java.lang.reflect.InvocationTargetException. Interestingly the last character of the dataset name is culled; which is potentially why there is an error.

The same dataset can be opened and queried in C as follows:
#include <hdf5.h>
#include <stdio.h>
int main()
{
  char S[32];
  hid_t f = H5Fopen( "test-symb.h5", H5P_DEFAULT,H5P_DEFAULT );
  H5Lget_name_by_idx( f, ".", H5_INDEX_NAME, H5_ITER_DEC, 0, S, 32, H5P_DEFAULT );
  H5Fclose( f );
  puts( S );
}
Although some terminals have trouble with symbols, piping the output to a file shows the expected result "T (°C)"

Any ideas on why HDFview seems to have problems with it?

Merry Christmas all!

Cheers,
Martijn
<test-symb.h5>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Hi Elena,
Thanks for your prompt response - hope you're getting a holiday too!!

It looks like I reduced by "minimal example" too far - the exception gets
thrown if a dataset's name contains a symbol and you look at its properties
in HDFView (new test file attached) - tested with HDFView 2.9 and 2.10 on
Win7, 64-bit.

<img src=‘//hdf-discourse-1.s3.amazonaws.com/original/1X/88938a6ad8c67bb7a631dd4bb2c8d4566ae80031.png’ width=‘442’ height=‘500’>

h5dump gives expected results:

HDF5 "test-symb.h5" {
GROUP "/" {
   DATASET "data (°C)" {
      DATATYPE H5T_STD_I32LE
      DATASPACE SIMPLE { ( 3, 4 ) / ( 3, 4 ) }
      DATA {
      (0,0): 1, 2, 3, 4,
      (1,0): 9, 8, 7, 6,
      (2,0): 100, 200, 300, 400
      }
      ATTRIBUTE "name" {
         DATATYPE H5T_STRING {
            STRSIZE H5T_VARIABLE;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
         DATASPACE SCALAR
         DATA {
         (0): "this is a test"
         }
      }
   }
}
}

Potentially this is because reading the name incorrectly leads to a failure
of probing the dataset's type (even though the program thinks it should
exist!). Interestingly, if you create a group whose name is entirely
symbols, it's interpreted as blank and turns into a link to the root node
in HDFView!

Finally, if a compound type is created with a name containing a symbol (the
original problem I had), that column is read out with default values
(test-symb2.h5). Again, I assume this is because the read compound is not
constructed correctly because of incorrect strings.

Cheers,
Martijn

test-symb.h5 (6.14 KB)

test-symb2.h5 (2.12 KB)

···

On 27 December 2013 12:18, Elena Pourmal <epourmal@hdfgroup.org> wrote:

Hi Martijn,

I can reproduce "truncated" name with HDFView - ")" is missing, but I am
not getting an exception with 2.10 on OS X 10.8.5. Which system are you
using?

h5dump produces correct result:
HDF5 "test-symb.h5" {
GROUP "/" {
   GROUP "T (°C)" {
   }
}
}
HDFView output is attached.

I will enter a bug report to fix the name in HDFView, but we will need to
reproduce the exception you are getting.

Thank you!

Elena
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Dec 23, 2013, at 6:47 PM, Martijn Jasperse <m.jasperse@gmail.com> > wrote:

Hi all,
I'm having some difficulty with HDFview when names (e.g. dataset
names/compound member names) contain standard symbols (e.g. degrees °).
HDF5 itself works fine, but unexpected behaviour is observed in HDFview
(seen in both 2.9 and 2.10) - such objects cannot be opened or queried.

In the simplest example, I've created a dataset that cannot be opened in
HDFview (double clicking the name has no effect), and choosing "Show
Properties" on the dataset results in a
java.lang.reflect.InvocationTargetException. Interestingly the last
character of the dataset name is culled; which is potentially why there is
an error.

The same dataset can be opened and queried in C as follows:

#include <hdf5.h>
#include <stdio.h>
int main()
{
char S[32];
hid_t f = H5Fopen( "test-symb.h5", H5P_DEFAULT,H5P_DEFAULT );
H5Lget_name_by_idx( f, ".", H5_INDEX_NAME, H5_ITER_DEC, 0, S, 32,
H5P_DEFAULT );
H5Fclose( f );
puts( S );
}

Although some terminals have trouble with symbols, piping the output to a
file shows the expected result "T (°C)"

Any ideas on why HDFview seems to have problems with it?

Merry Christmas all!

Cheers,
Martijn
<test-symb.h5>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org

http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Hi Martijn,

···

On Dec 26, 2013, at 6:40 PM, Martijn Jasperse <m.jasperse@gmail.com> wrote:

Hi Elena,
Thanks for your prompt response - hope you're getting a holiday too!!

Of course! :slight_smile:
Thank you for the examples! I reproduced both problems on my Mac. For you reference this is a JIRA issue JAVA-1807.

Elena
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It looks like I reduced by "minimal example" too far - the exception gets thrown if a dataset's name contains a symbol and you look at its properties in HDFView (new test file attached) - tested with HDFView 2.9 and 2.10 on Win7, 64-bit.

<image.png>

h5dump gives expected results:
HDF5 "test-symb.h5" {
GROUP "/" {
   DATASET "data (°C)" {
      DATATYPE H5T_STD_I32LE
      DATASPACE SIMPLE { ( 3, 4 ) / ( 3, 4 ) }
      DATA {
      (0,0): 1, 2, 3, 4,
      (1,0): 9, 8, 7, 6,
      (2,0): 100, 200, 300, 400
      }
      ATTRIBUTE "name" {
         DATATYPE H5T_STRING {
            STRSIZE H5T_VARIABLE;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
         DATASPACE SCALAR
         DATA {
         (0): "this is a test"
         }
      }
   }
}
}

Potentially this is because reading the name incorrectly leads to a failure of probing the dataset's type (even though the program thinks it should exist!). Interestingly, if you create a group whose name is entirely symbols, it's interpreted as blank and turns into a link to the root node in HDFView!

Finally, if a compound type is created with a name containing a symbol (the original problem I had), that column is read out with default values (test-symb2.h5). Again, I assume this is because the read compound is not constructed correctly because of incorrect strings.

Cheers,
Martijn

On 27 December 2013 12:18, Elena Pourmal <epourmal@hdfgroup.org> wrote:
Hi Martijn,

I can reproduce "truncated" name with HDFView - ")" is missing, but I am not getting an exception with 2.10 on OS X 10.8.5. Which system are you using?

h5dump produces correct result:
HDF5 "test-symb.h5" {
GROUP "/" {
   GROUP "T (°C)" {
   }
}
}
HDFView output is attached.

I will enter a bug report to fix the name in HDFView, but we will need to reproduce the exception you are getting.

Thank you!

Elena
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<HDFView-window.png>

On Dec 23, 2013, at 6:47 PM, Martijn Jasperse <m.jasperse@gmail.com> wrote:

Hi all,
I'm having some difficulty with HDFview when names (e.g. dataset names/compound member names) contain standard symbols (e.g. degrees °). HDF5 itself works fine, but unexpected behaviour is observed in HDFview (seen in both 2.9 and 2.10) - such objects cannot be opened or queried.

In the simplest example, I've created a dataset that cannot be opened in HDFview (double clicking the name has no effect), and choosing "Show Properties" on the dataset results in a java.lang.reflect.InvocationTargetException. Interestingly the last character of the dataset name is culled; which is potentially why there is an error.

The same dataset can be opened and queried in C as follows:
#include <hdf5.h>
#include <stdio.h>
int main()
{
  char S[32];
  hid_t f = H5Fopen( "test-symb.h5", H5P_DEFAULT,H5P_DEFAULT );
  H5Lget_name_by_idx( f, ".", H5_INDEX_NAME, H5_ITER_DEC, 0, S, 32, H5P_DEFAULT );
  H5Fclose( f );
  puts( S );
}
Although some terminals have trouble with symbols, piping the output to a file shows the expected result "T (°C)"

Any ideas on why HDFview seems to have problems with it?

Merry Christmas all!

Cheers,
Martijn
<test-symb.h5>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

<test-symb.h5><test-symb2.h5>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org