diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-10-06 05:16:51 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-10-06 05:16:51 (GMT) |
commit | 75b84b09bd249b36a063fd51ecd3383801b0118b (patch) | |
tree | 06eec7c56a35417e4613e5a2b0bf3dfaf6c3de5a /src | |
parent | 1b2c820b4bdb0a176cba20ccdb87b07f7ab5eede (diff) | |
download | hdf5-75b84b09bd249b36a063fd51ecd3383801b0118b.zip hdf5-75b84b09bd249b36a063fd51ecd3383801b0118b.tar.gz hdf5-75b84b09bd249b36a063fd51ecd3383801b0118b.tar.bz2 |
Updated the H5I debug dump to not segfault when types are not initialized
or contain zero IDs in the skip list.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5I.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -2188,15 +2188,22 @@ H5I_dump_ids_for_type(H5I_type_t type) HDfprintf(stderr, "Dumping ID type %d\n", (int)type); type_ptr = H5I_id_type_list_g[type]; - /* Header */ - HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); - HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); - HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); - - /* List */ - HDfprintf(stderr, " List:\n"); - H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type); + if(type_ptr) { + + /* Header */ + HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); + HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); + HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); + HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); + + /* List */ + if(type_ptr->id_count > 0) { + HDfprintf(stderr, " List:\n"); + H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type); + } + } + else + HDfprintf(stderr, "Global type info/tracking pointer for that type is NULL\n"); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5I_dump_ids_for_type() */ |