-
-
Notifications
You must be signed in to change notification settings - Fork 301
Fix assertion failure in H5S__copy_pnt_list() #5352
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
Conversation
de1f40f
to
293b777
Compare
Foiled again by the linkchecker |
293b777
to
4ba5c1a
Compare
@qkoziol apologies on the timing; realized I should add a release note even though the issue is a minor one. |
|
||
/* Allocate room for the head of the point list */ | ||
if (NULL == (dst = H5FL_CALLOC(H5S_pnt_list_t))) | ||
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate point list node"); | ||
|
||
/* If source dataspace has no extent, just return new point list node */ | ||
if (rank == 0) | ||
HGOTO_DONE(dst); |
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.
@qkoziol I'm considering revising this. While it makes sense to me to return an empty point list node when the dataspace's extent has 0 dimensions (as we can't even tell how to copy the points over in that case), this causes problems elsewhere where the library expects space->select.sel_info.pnt_lst->head
to be non-NULL. I have a fix for that as well, but I'm thinking of just having H5Scopy()
/ H5Sselect_copy()
return failure for point and hyperslab selection dataspaces with a 0 dimension extent, since they both don't support H5S_SCALAR
or H5S_NULL
dataspaces and can only end up here when H5Sset_extent_none()
is called on them. Thoughts?
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 be fine. Another solution might be to have H5Sset_extent_none() clear the selection also (since you can't select anything within a "none" extent"). Generically, I would suggest reseting the selection any time that the extent's rank changes (also).
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 seems like a better solution to me. I suppose it makes sense to reset the selection to 'all' since that's what dataspaces start with?
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.
Agree, back to 'all' for all changes in rank would be consistent with dataspace creation.
@ellipsis-dev, review PR. |
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.
Caution
Changes requested ❌
Reviewed everything up to d9e2032 in 1 minute and 58 seconds. Click for details.
- Reviewed
115
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. test/th5s.c:1689
- Draft comment:
Test code in H5S_check_encoding uses hard-coded buffer offsets (e.g. buf[35] and buf[39]) to verify the encoded version and encoded size. Consider defining named constants or adding detailed comments, as these magic numbers are brittle if the encoding format changes. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_0axEUbe3fKUn9nQg
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
CHECK(ret, FAIL, "H5Sset_extent_none"); | ||
|
||
space_copy_id = H5Scopy(space_id); | ||
CHECK(space_id, H5I_INVALID_HID, "H5Scopy"); |
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.
In test_h5s_bug4, the CHECK() call is mistakenly checking 'space_id' rather than the returned 'space_copy_id' from H5Scopy. Change it to CHECK(space_copy_id, H5I_INVALID_HID, "H5Scopy").
CHECK(space_id, H5I_INVALID_HID, "H5Scopy"); | |
CHECK(space_copy_id, H5I_INVALID_HID, "H5Scopy"); |
Will address with a different solution later |
Important
Fix assertion failure in
H5S__copy_pnt_list()
by adding a zero rank check and update tests.H5S__copy_pnt_list()
inH5Spoint.c
by adding a check for zero rank and converting the assertion to a normal error check.test_h5s_bug4()
inth5s.c
to test copying a dataspace with a point selection after extent reset withH5Sset_extent_none()
.RELEASE.txt
to document the fix for the assertion failure inH5S__copy_pnt_list()
.This description was created by
for d9e2032. You can customize this summary. It will automatically update as commits are pushed.