Repository navigation
Conversation
H5Pget_driver_info() pushed H5E_CANTGET whenever H5P_peek_driver_info()
returned NULL. NULL is not necessarily a failure there: a driver that
registered no driver-specific properties leaves driver_info NULL, which is
what H5Pset_driver_by_name() and the HDF5_DRIVER environment variable both
produce.
Both the function's own header comment and its entry in H5Ppublic.h say
that case returns NULL with no error pushed:
Failure: NULL. Null is also returned if the driver has
not registered any driver-specific properties
although no error is pushed on the stack in
this case.
The sibling H5Pget_driver_config_str() already handles the same situation
correctly. The effect of the mismatch is that any VFD which fetches its
optional FAPL info block -- including HDF5's own H5FDmulti.c, in four
places -- prints an HDF5-DIAG stack on every open describing an error that
did not occur.
The two genuine failures still report themselves: H5P_peek_driver_info()
pushes H5E_BADTYPE for a list that is not a file access property list, and
H5E_CANTGET when the property cannot be read. The removed frame only ever
duplicated those or fired on a normal NULL.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hyoklee
requested review from
fortnern,
glennsong09,
jhendersonHDF,
mattjala and
vchoi-hdfgroup
as code owners
August 29, 2026 04:01
github-actions
Bot
removed request for
glennsong09,
jhendersonHDF,
mattjala and
vchoi-hdfgroup
August 29, 2026 04:04
Contributor
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
Member
Author
|
Verified with a minimal reproducer. if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) return 1;
if (H5Pset_driver_by_name(fapl, "sec2", NULL) < 0) return 1;
info = H5Pget_driver_info(fapl);
nerrs = H5Eget_num(H5E_DEFAULT);Before, on After: Same return value, and the stack is now clean — which is what the documented contract says should have been happening all along. |
hyoklee
added a commit
to hyoklee/hdf5
that referenced
this pull request
Aug 29, 2026
H5Pget_driver_info() pushed H5E_CANTGET whenever H5P_peek_driver_info() returned NULL, which is a normal return when the driver registered no driver-specific properties -- what H5Pset_driver_by_name() and the HDF5_DRIVER environment variable both produce. Both the function's own header comment and its entry in H5Ppublic.h document that case as returning NULL with nothing pushed. Clean merge; also picks up the two upstream develop commits the fork did not have. HDFGroup#6652. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6651.
H5Pget_driver_info()pushedH5E_CANTGETwheneverH5P_peek_driver_info()returned NULL. NULL is not necessarily a failure there: a driver that registered no driver-specific properties leavesdriver_infoNULL, which is exactly whatH5Pset_driver_by_name()and theHDF5_DRIVERenvironment variable produce.Both the function's own header comment and its entry in
H5Ppublic.hsay that case returns NULL with no error pushed:and
The sibling
H5Pget_driver_config_str()already handles the same situation correctly:Effect
Any VFD that fetches its optional FAPL info block — including HDF5's own
H5FDmulti.c, in four places — prints an HDF5-DIAG stack on every open describing an error that did not occur:I hit this running the netCDF-C test suite over an out-of-tree VFD selected with
HDF5_DRIVER=<name>: everyH5Fopenin the run produced one of these. Harmless to the operation, but not to testing — any test comparing a program's stderr against a reference sees a diff, and someone reading the output of a driver under development is told there is an error when there is not.The change
Drop the wrapper
HGOTO_ERRORand assign the result. Nothing that was diagnosed stops being diagnosed:H5P_peek_driver_info()pushesH5E_BADTYPEitself for a list that is not a file access property list, andH5E_CANTGETwhen the property cannot be read. The removed frame only ever duplicated one of those or fired on a normal NULL.Not a recent regression — the code dates to at least [svn-r15510] (2008).
🤖 Generated with Claude Code