summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-08-24 19:37:33 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-08-24 19:37:33 (GMT)
commit1115133e11e43c45f5f20d74ca4bae76815c63d3 (patch)
tree9b49c294e065f948f46c9c4ea83f88100a083f59
parente4299d463efa0736bc51513b15827e58046cc061 (diff)
parent5cc911f3ba2c5d12c3305b348610f9ba80c85db2 (diff)
downloadhdf5-1115133e11e43c45f5f20d74ca4bae76815c63d3.zip
hdf5-1115133e11e43c45f5f20d74ca4bae76815c63d3.tar.gz
hdf5-1115133e11e43c45f5f20d74ca4bae76815c63d3.tar.bz2
Merge pull request #640 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit '5cc911f3ba2c5d12c3305b348610f9ba80c85db2': HDFFV-10188 Force non-native type description HDFFV-10188 merge fix and tests from develop
-rw-r--r--MANIFEST4
-rw-r--r--release_docs/RELEASE.txt10
-rw-r--r--tools/h5dump/CMakeTests.cmake5
-rw-r--r--tools/h5dump/CMakeTestsXML.cmake8
-rw-r--r--tools/h5dump/h5dump_xml.c38
-rw-r--r--tools/h5dump/h5dumpgentest.c39
-rw-r--r--tools/h5dump/testh5dump.sh.in3
-rw-r--r--tools/h5dump/testh5dumpxml.sh.in6
-rw-r--r--tools/h5ls/CMakeTests.cmake7
-rw-r--r--tools/h5ls/h5ls.c62
-rw-r--r--tools/h5ls/testh5ls.sh.in5
-rw-r--r--tools/lib/h5tools_ref.c5
-rw-r--r--tools/testfiles/tgrpnullspace.ddl33
-rw-r--r--tools/testfiles/tgrpnullspace.h5bin0 -> 2504 bytes
-rw-r--r--tools/testfiles/tgrpnullspace.ls7
-rw-r--r--tools/testfiles/tnullspace.h5.xml39
16 files changed, 215 insertions, 56 deletions
diff --git a/MANIFEST b/MANIFEST
index 48d8af7..16900d2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1390,6 +1390,9 @@
./tools/testfiles/tgrp_comments.ls
./tools/testfiles/tgrp_comments.ddl
./tools/testfiles/tgrp_comments.h5
+./tools/testfiles/tgrpnullspace.h5
+./tools/testfiles/tgrpnullspace.ddl
+./tools/testfiles/tgrpnullspace.ls
./tools/testfiles/thlink-1.ddl
./tools/testfiles/thlink-2.ddl
./tools/testfiles/thlink-3.ddl
@@ -1445,6 +1448,7 @@
./tools/testfiles/tno-subset.h5
./tools/testfiles/tno-subset.ddl
./tools/testfiles/tnullspace.h5
+./tools/testfiles/tnullspace.h5.xml
./tools/testfiles/tnullspace.ddl
./tools/testfiles/tobjref.h5
./tools/testfiles/topaque.h5
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index f538aa2..d7381ca 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -120,6 +120,16 @@ Bug Fixes since HDF5-1.8.19
Tools
-----
+ - h5ls
+
+ h5ls generated error on stack when it encountered a H5S_NULL
+ dataspace.
+
+ Adding checks for H5S_NULL before calling H5Sis_simple (located
+ in the h5tools_dump_mem function) fixed the issue.
+
+ (ADB - 2017/08/17, HDFFV-10188)
+
- h5dump
h5dump segfaulted on output of XML file.
diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake
index 0978265..d930edd 100644
--- a/tools/h5dump/CMakeTests.cmake
+++ b/tools/h5dump/CMakeTests.cmake
@@ -103,6 +103,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-2.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-3.ddl
@@ -270,6 +271,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tfvalues.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dims.h5
@@ -883,6 +885,8 @@
tgroup-2.out.err
tgrp_comments.out
tgrp_comments.out.err
+ tgrpnullspace.out
+ tgrpnullspace.out.err
thlink-1.out
thlink-1.out.err
thlink-2.out
@@ -1389,6 +1393,7 @@
# test for displaying dataset and attribute of null space
ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5)
+ ADD_H5_TEST (tgrpnullspace 0 -p --enable-error-stack tgrpnullspace.h5)
# test for displaying dataset and attribute of space with 0 dimension size
ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5)
diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake
index 595d0b5..9a3b511 100644
--- a/tools/h5dump/CMakeTestsXML.cmake
+++ b/tools/h5dump/CMakeTestsXML.cmake
@@ -53,6 +53,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/test35.nc
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5
@@ -117,6 +118,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5.xml
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5.xml
${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5.xml
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5.xml
${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5.xml
${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5.xml
${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.h5.xml
@@ -296,6 +298,8 @@
tnodata.h5.out.err
tnoname.h5.out
tnoname.h5.out.err
+ tnullspace.h5.out
+ tnullspace.h5.out.err
tobjref.h5.out
tobjref.h5.out.err
topaque.h5.out
@@ -402,9 +406,7 @@
ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5)
ADD_XML_H5_TEST (tempty.h5 0 tempty.h5)
ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5)
- ##Test dataset and attribute of null space. Commented out:
- ## wait until the XML schema is updated for null space.
- ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5)
+ ADD_XML_H5_TEST (tnullspace.h5 0 tnullspace.h5)
## So is dataspace with 0 dimension size.
## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5)
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index ee897ae..089419b 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -1958,28 +1958,32 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset,
H5Tclose(type);
space = H5Aget_space(obj_id);
+ if(space == H5S_NULL || space == H5S_NO_CLASS) {
+ status = SUCCEED;
+ }
+ else {
+ ndims = H5Sget_simple_extent_dims(space, size, NULL);
- ndims = H5Sget_simple_extent_dims(space, size, NULL);
+ for (i = 0; i < ndims; i++)
+ nelmts *= size[i];
- for (i = 0; i < ndims; i++)
- nelmts *= size[i];
+ buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))));
+ HDassert(buf);
- buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))));
- HDassert(buf);
+ if (H5Aread(obj_id, p_type, buf) >= 0) {
+ h5tools_context_t datactx;
+ HDmemset(&datactx, 0, sizeof(datactx));
+ datactx.need_prefix = TRUE;
+ datactx.indent_level = ctx.indent_level;
+ datactx.cur_column = ctx.cur_column;
+ status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf);
+ }
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data)
+ H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
- if (H5Aread(obj_id, p_type, buf) >= 0) {
- h5tools_context_t datactx;
- HDmemset(&datactx, 0, sizeof(datactx));
- datactx.need_prefix = TRUE;
- datactx.indent_level = ctx.indent_level;
- datactx.cur_column = ctx.cur_column;
- status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf);
+ HDfree(buf);
}
- /* Reclaim any VL memory, if necessary */
- if (vl_data)
- H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
-
- HDfree(buf);
H5Tclose(p_type);
H5Sclose(space);
H5Tclose(type);
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index c74e800..f9450cb 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -112,6 +112,7 @@
#define FILE82 "tcompound_complex2.h5"
#define FILE83 "tvlenstr_array.h5"
#define FILE84 "tudfilter.h5"
+#define FILE85 "tgrpnullspace.h5"
/*-------------------------------------------------------------------------
* prototypes
@@ -10289,6 +10290,43 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
*-------------------------------------------------------------------------
*/
+/*-------------------------------------------------------------------------
+ * Function: gent_null_space_group
+ *
+ * Purpose: generates dataset and attribute of null dataspace in a group
+ *-------------------------------------------------------------------------
+ */
+static void gent_null_space_group(void)
+{
+ hid_t fid, root, group, dataset, space, attr;
+ int dset_buf = 10;
+ int point = 4;
+
+ fid = H5Fcreate(FILE85, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ root = H5Gopen2(fid, "/", H5P_DEFAULT);
+
+ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* null space */
+ space = H5Screate(H5S_NULL);
+
+ /* dataset */
+ dataset = H5Dcreate2(group, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ /* nothing should be written */
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf);
+
+ /* attribute */
+ attr = H5Acreate2(group, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT);
+ H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */
+
+ H5Dclose(dataset);
+ H5Aclose(attr);
+ H5Gclose(group);
+ H5Gclose(root);
+ H5Sclose(space);
+ H5Fclose(fid);
+}
+
int main(void)
{
gent_group();
@@ -10376,6 +10414,7 @@ int main(void)
gent_bitnopaquefields();
gent_intsfourdims();
+ gent_null_space_group();
gent_udfilter();
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index f941afc..9ceffa5 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -131,6 +131,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.h5
$SRC_H5DUMP_TESTFILES/tfvalues.h5
$SRC_H5DUMP_TESTFILES/tgroup.h5
$SRC_H5DUMP_TESTFILES/tgrp_comments.h5
+$SRC_H5DUMP_TESTFILES/tgrpnullspace.h5
$SRC_H5DUMP_TESTFILES/thlink.h5
$SRC_H5DUMP_TESTFILES/thyperslab.h5
$SRC_H5DUMP_TESTFILES/tintsattrs.h5
@@ -258,6 +259,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.ddl
$SRC_H5DUMP_TESTFILES/tgroup-1.ddl
$SRC_H5DUMP_TESTFILES/tgroup-2.ddl
$SRC_H5DUMP_TESTFILES/tgrp_comments.ddl
+$SRC_H5DUMP_TESTFILES/tgrpnullspace.ddl
$SRC_H5DUMP_TESTFILES/thlink-1.ddl
$SRC_H5DUMP_TESTFILES/thlink-2.ddl
$SRC_H5DUMP_TESTFILES/thlink-3.ddl
@@ -1265,6 +1267,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5
# test for displaying dataset and attribute of null space
TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5
+TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5
# test for displaying dataset and attribute of space with 0 dimension size
TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 64dd737..8aa8811 100644
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -97,6 +97,7 @@ $SRC_H5DUMP_TESTFILES/tname-sp.h5
$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5
$SRC_H5DUMP_TESTFILES/tnestedcomp.h5
$SRC_H5DUMP_TESTFILES/tnodata.h5
+$SRC_H5DUMP_TESTFILES/tnullspace.h5
$SRC_H5DUMP_TESTFILES/tobjref.h5
$SRC_H5DUMP_TESTFILES/topaque.h5
$SRC_H5DUMP_TESTFILES/torderattr.h5
@@ -162,6 +163,7 @@ $SRC_H5DUMP_TESTFILES/tname-quot.h5.xml
$SRC_H5DUMP_TESTFILES/tname-sp.h5.xml
$SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml
$SRC_H5DUMP_TESTFILES/tnodata.h5.xml
+$SRC_H5DUMP_TESTFILES/tnullspace.h5.xml
$SRC_H5DUMP_TESTFILES/tobjref.h5.xml
$SRC_H5DUMP_TESTFILES/topaque.h5.xml
$SRC_H5DUMP_TESTFILES/torderattr1.h5.xml
@@ -355,9 +357,7 @@ TOOLTEST tvlstr.h5.xml --xml tvlstr.h5
TOOLTEST tsaf.h5.xml --xml tsaf.h5
TOOLTEST tempty.h5.xml --xml tempty.h5
TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5
-##Test dataset and attribute of null space. Commented out:
-## wait until the XML schema is updated for null space.
-##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5
+TOOLTEST tnullspace.h5.xml --xml tnullspace.h5
# other options for xml
diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake
index 343949a..a839518 100644
--- a/tools/h5ls/CMakeTests.cmake
+++ b/tools/h5ls/CMakeTests.cmake
@@ -33,6 +33,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5
@@ -88,6 +89,7 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls
${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls
@@ -239,6 +241,8 @@
textlinksrc-7-old.out.err
tgrp_comments.out
tgrp_comments.out.err
+ tgrpnullspace.out
+ tgrpnullspace.out.err
tsoftlinks-1.out
tsoftlinks-1.out.err
tsoftlinks-2.out
@@ -413,6 +417,9 @@
# test for empty data
ADD_H5_TEST (tempty 0 -w80 -d tempty.h5)
+ # test for displaying dataset and attribute of null space
+ ADD_H5_TEST (tgrpnullspace 0 -w80 -v -S tgrpnullspace.h5)
+
# test for all dataset types written to attributes
# enable -S for avoiding printing NATIVE types
ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5)
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 7daf7e3..a58b96b 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1616,38 +1616,40 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
info = &outputformat;
- if(hexdump_g)
- p_type = H5Tcopy(type);
- else
- p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
-
- if(p_type >= 0) {
- /* VL data special information */
- unsigned int vl_data = 0; /* contains VL datatypes */
-
- /* Check if we have VL data in the dataset's datatype */
- if (h5tools_detect_vlen(p_type) == TRUE)
- vl_data = TRUE;
-
- temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type));
- HDassert(temp_need == (hsize_t)((size_t)temp_need));
- need = (size_t)temp_need;
- buf = HDmalloc(need);
- HDassert(buf);
- if(H5Aread(attr, p_type, buf) >= 0) {
- ctx.need_prefix = TRUE;
- ctx.indent_level = 2;
- ctx.cur_column = (size_t)curr_pos;
- h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf);
- }
+ if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) {
+ if(hexdump_g)
+ p_type = H5Tcopy(type);
+ else
+ p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
+
+ if(p_type >= 0) {
+ /* VL data special information */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5tools_detect_vlen(p_type) == TRUE)
+ vl_data = TRUE;
+
+ temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type));
+ HDassert(temp_need == (hsize_t)((size_t)temp_need));
+ need = (size_t)temp_need;
+ buf = HDmalloc(need);
+ HDassert(buf);
+ if(H5Aread(attr, p_type, buf) >= 0) {
+ ctx.need_prefix = TRUE;
+ ctx.indent_level = 2;
+ ctx.cur_column = (size_t)curr_pos;
+ h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf);
+ }
- /* Reclaim any VL memory, if necessary */
- if (vl_data)
- H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data)
+ H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
- HDfree(buf);
- H5Tclose(p_type);
- } /* end if */
+ HDfree(buf);
+ H5Tclose(p_type);
+ } /* end if */
+ }
H5Sclose(space);
H5Tclose(type);
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index 4b57acc..40bb529 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -80,6 +80,7 @@ $SRC_H5LS_TESTFILES/textlinksrc.h5
$SRC_H5LS_TESTFILES/textlinktar.h5
$SRC_H5LS_TESTFILES/tgroup.h5
$SRC_H5LS_TESTFILES/tgrp_comments.h5
+$SRC_H5LS_TESTFILES/tgrpnullspace.h5
$SRC_H5LS_TESTFILES/thlink.h5
$SRC_H5LS_TESTFILES/tloop.h5
$SRC_H5LS_TESTFILES/tnestedcomp.h5
@@ -134,6 +135,7 @@ $SRC_H5LS_TESTFILES/tgroup.ls
$SRC_H5LS_TESTFILES/tgroup-1.ls
$SRC_H5LS_TESTFILES/tgroup-2.ls
$SRC_H5LS_TESTFILES/tgroup-3.ls
+$SRC_H5LS_TESTFILES/tgrpnullspace.ls
$SRC_H5LS_TESTFILES/thlink-1.ls
$SRC_H5LS_TESTFILES/tloop-1.ls
$SRC_H5LS_TESTFILES/tmultifile.ls
@@ -390,6 +392,9 @@ TOOLTEST tarray1.ls 0 -w80 -r -d tarray1.h5
# test for empty data
TOOLTEST tempty.ls 0 -w80 -d tempty.h5
+# test for displaying dataset and attribute of null space
+TOOLTEST tgrpnullspace.ls 0 -w80 -v -S tgrpnullspace.h5
+
# test for all dataset types written to attributes
# enable -S for avoiding printing NATIVE types
TOOLTEST tattr2.ls 0 -w80 -v -S tattr2.h5
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 85850e3..16a949d 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -11,8 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdio.h>
-#include <stdlib.h>
#include "h5tools_ref.h"
#include "H5private.h"
#include "H5SLprivate.h"
@@ -166,7 +164,8 @@ haddr_t
ref_path_table_lookup(const char *thepath)
{
H5O_info_t oi;
-
+ if((HDstrlen(thepath) == 0) || (thepath == NULL))
+ return HADDR_UNDEF;
/* Allow lookups on the root group, even though it doesn't have any link info */
if(HDstrcmp(thepath, "/")) {
H5L_info_t li;
diff --git a/tools/testfiles/tgrpnullspace.ddl b/tools/testfiles/tgrpnullspace.ddl
new file mode 100644
index 0000000..2b91527
--- /dev/null
+++ b/tools/testfiles/tgrpnullspace.ddl
@@ -0,0 +1,33 @@
+HDF5 "tgrpnullspace.h5" {
+GROUP "/" {
+ GROUP "g1" {
+ ATTRIBUTE "attr" {
+ DATATYPE H5T_STD_U32LE
+ DATASPACE NULL
+ DATA {
+ }
+ }
+ DATASET "dset" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE NULL
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 0
+ OFFSET 18446744073709551615
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tgrpnullspace.h5 b/tools/testfiles/tgrpnullspace.h5
new file mode 100644
index 0000000..82a405e
--- /dev/null
+++ b/tools/testfiles/tgrpnullspace.h5
Binary files differ
diff --git a/tools/testfiles/tgrpnullspace.ls b/tools/testfiles/tgrpnullspace.ls
new file mode 100644
index 0000000..439414c
--- /dev/null
+++ b/tools/testfiles/tgrpnullspace.ls
@@ -0,0 +1,7 @@
+Opened "tgrpnullspace.h5" with sec2 driver.
+g1 Group
+ Attribute: attr null
+ Type: 32-bit little-endian unsigned integer
+
+ Location: 1:800
+ Links: 1
diff --git a/tools/testfiles/tnullspace.h5.xml b/tools/testfiles/tnullspace.h5.xml
new file mode 100644
index 0000000..b1c1974
--- /dev/null
+++ b/tools/testfiles/tnullspace.h5.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
+ <hdf5:Attribute Name="attr">
+ <hdf5:Dataspace>
+ <!-- unknown dataspace -->
+ </hdf5:Dataspace>
+ <hdf5:DataType>
+ <hdf5:AtomicType>
+ <hdf5:IntegerType ByteOrder="LE" Sign="false" Size="4" />
+ </hdf5:AtomicType>
+ </hdf5:DataType>
+ <hdf5:Data>
+ <hdf5:NoData/>
+ </hdf5:Data>
+ </hdf5:Attribute>
+ <hdf5:Dataset Name="dset" OBJ-XID="xid_976" H5Path= "/dset" Parents="xid_928" H5ParentPaths="/">
+ <hdf5:StorageLayout>
+ <hdf5:ContiguousLayout/>
+ </hdf5:StorageLayout>
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValue>
+ <hdf5:NoFill/>
+ </hdf5:FillValue>
+ </hdf5:FillValueInfo>
+ <hdf5:Dataspace>
+ <!-- unknown dataspace -->
+ </hdf5:Dataspace>
+ <hdf5:DataType>
+ <hdf5:AtomicType>
+ <hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
+ </hdf5:AtomicType>
+ </hdf5:DataType>
+ <hdf5:Data>
+ <hdf5:NoData/>
+ </hdf5:Data>
+ </hdf5:Dataset>
+</hdf5:RootGroup>
+</hdf5:HDF5-File>