Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed H5Ovisit2() change of behavior between 1.10.11 and v1.14.4.3 #5022

Merged
merged 16 commits into from
Nov 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/H5Oint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or
H5O_loc_t obj_oloc; /* Opened object object location */
bool loc_found = false; /* Entry at 'name' found */
H5O_info2_t oinfo; /* Object info struct */
H5O_info2_t int_oinfo; /* Internal object info */
void *obj = NULL; /* Object */
H5I_type_t opened_type; /* ID type of object */
hid_t obj_id = H5I_INVALID_HID; /* ID of object */
Expand Down Expand Up @@ -2650,6 +2651,10 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or
if (H5O_get_info(&obj_oloc, &oinfo, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info");

/* Get the object's basic info for local use */
if (H5O_get_info(&obj_oloc, &int_oinfo, H5O_INFO_BASIC) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object's basic info");

/* Open the object */
/* (Takes ownership of the obj_loc information) */
if (NULL == (obj = H5O_open_by_loc(&obj_loc, &opened_type)))
Expand All @@ -2668,7 +2673,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or
HGOTO_DONE(ret_value);

/* Check for object being a group */
if (oinfo.type == H5O_TYPE_GROUP) {
if (int_oinfo.type == H5O_TYPE_GROUP) {
H5G_loc_t start_loc; /* Location of starting group */
H5G_loc_t vis_loc; /* Location of visited group */

Expand All @@ -2689,18 +2694,18 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or

/* If its ref count is > 1, we add it to the list of visited objects */
/* (because it could come up again during traversal) */
if (oinfo.rc > 1) {
if (int_oinfo.rc > 1) {
H5_obj_t *obj_pos; /* New object node for visited list */

/* Allocate new object "position" node */
if ((obj_pos = H5FL_MALLOC(H5_obj_t)) == NULL)
HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "can't allocate object node");

/* Construct unique "position" for this object */
obj_pos->fileno = oinfo.fileno;
obj_pos->fileno = int_oinfo.fileno;

/* De-serialize object token into an object address */
if (H5VL_native_token_to_addr(loc->oloc->file, H5I_FILE, oinfo.token, &(obj_pos->addr)) < 0)
if (H5VL_native_token_to_addr(loc->oloc->file, H5I_FILE, int_oinfo.token, &(obj_pos->addr)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, FAIL,
"can't deserialize object token into address");

Expand Down
Loading