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

Remove H5E_clear_stack() from library #4871

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
3 changes: 1 addition & 2 deletions src/H5Gloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,7 @@ H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_
*
* Purpose: Check if an object actually exists at a location
*
* Return: Success: true/false
* Failure: Negative
* Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
Expand Down
22 changes: 14 additions & 8 deletions src/H5Ocopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,22 +1464,28 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i

/* Walk through the list of datatype suggestions */
while (suggestion) {
bool exists = false;

/* Find the object */
if (H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc /*out*/) < 0)
/* Ignore errors - i.e. suggestions not present in
* destination file */
H5E_clear_stack();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you haven't already, it's worth documenting that developers should avoid calling H5E_clear_stack() in the library since I can easily see this cropping up again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll add that in the next PR.

else
if (H5G_loc_exists(&dst_root_loc, suggestion->path, &exists /*out*/) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFIND, FAIL, "can't check object's existence");

if (exists) {
/* Retrieve the object location info */
if (H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc /*out*/) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object location");

/* Check object and add to skip list if appropriate */
if (H5O__copy_search_comm_dt_check(&obj_oloc, &udata) < 0) {
if (H5G_loc_free(&obj_loc) < 0)
HERROR(H5E_OHDR, H5E_CANTRELEASE, "can't free location");
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't check object");
} /* end if */

/* Free location */
if (H5G_loc_free(&obj_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location");
/* Free location */
if (H5G_loc_free(&obj_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location");
} /* end if */

/* Advance the suggestion pointer */
suggestion = suggestion->next;
Expand Down
Loading