-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Conversation
H5O__visit() uses the object information to be returned to the application, so when the application did not request for certain information, they were not available to H5O__visit. This lack of information caused incorrect behavior down the road. We now call H5O_get_info again providing H5O_INFO_BASIC for "fields", so we can obtain correct object information for H5O__visit to use. Fixes HDFGroupGH-4941
Does this need a note in RELEASE.txt? |
src/H5Oint.c
Outdated
@@ -2684,15 +2694,17 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or | |||
HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register visited object"); | |||
|
|||
/* Make callback for starting object */ | |||
if ((ret_value = op(obj_id, ".", &oinfo, op_data)) < 0) | |||
/* if ((ret_value = op(obj_id, ".", oinfop, op_data)) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
src/H5Oint.c
Outdated
if ((ret_value = op(obj_id, ".", &oinfo, op_data)) < 0) | ||
/* if ((ret_value = op(obj_id, ".", oinfop, op_data)) < 0) | ||
*/ | ||
if ((ret_value = op(obj_id, ".", oinfop, op_data)) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work when the application's fields don't include BASIC. The oinfop will be pointing at the wrong struct.
You can fix it by moving the block of code with the query on the internal oinfo below this point. (I suggest below the check for H5_ITER_CONT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, actually, it was oinfo there before I switched to oinfop, but now I see that oinfo would be the correct one. I'll switch it back unless you disagree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also work :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll note that no tests were failing when this was wrong. You should probably add a test that fails (now), so you can be certain it's working after you correct it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I did add one test that used H5O_INFO_META_SIZE, so no BASIC..., but no failure. OK, back to work... :)
scenario introduced by that typo.
Oops, I didn't mean to close it. I need to fix a mistake but I'm out right now. |
@@ -1929,6 +2088,8 @@ cleanup_h5o(void H5_ATTR_UNUSED *params) | |||
{ | |||
h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); | |||
H5Fdelete(filename, H5P_DEFAULT); | |||
h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); | |||
H5Fdelete(filename, H5P_DEFAULT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this duplicated? Should this second statement be VISIT2_FILENAME?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
…DFGroup#5022) H5O__visit() uses the object information to be returned to the application, so when the application did not request for certain information, they were not available to H5O__visit. This lack of information caused incorrect behavior down the road. We now call H5O_get_info again providing H5O_INFO_BASIC for "fields", so we can obtain correct object information for H5O__visit to use. Fixes HDFGroup#4941
…DFGroup#5022) H5O__visit() uses the object information to be returned to the application, so when the application did not request for certain information, they were not available to H5O__visit. This lack of information caused incorrect behavior down the road. We now call H5O_get_info again providing H5O_INFO_BASIC for "fields", so we can obtain correct object information for H5O__visit to use. Fixes HDFGroup#4941
H5O__visit() uses the object information to be returned to the application, so when the application did not request for certain information, they were not available to H5O__visit(). This lack of information caused incorrect behavior down the road.
We now call H5O_get_info() again providing H5O_INFO_BASIC for "fields", so we can obtain correct object information for H5O__visit() to use.
Fixes GH-4941