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

Fix assertion failure when attempting to use IOC VFD directly #3187

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@ Bug Fixes since HDF5-1.14.0 release
===================================
Library
-------
- Fixed an assertion failure when attempting to use the Subfiling IOC
VFD directly

The Subfiling feature makes use of two Virtual File Drivers, the
Subfiling VFD and the IOC (I/O Concentrator) VFD. The two VFDs are
intended to be stacked together such that the Subfiling VFD sits
"on top" of the IOC VFD and routes I/O requests through it; using the
IOC VFD alone is currently unsupported. The IOC VFD has been fixed so
that an error message is displayed in this situation rather than causing
an assertion failure.

- Fixed a potential bug when copying empty enum datatypes

Copying an empty enum datatype (including implicitly, as when an enum
Expand Down
13 changes: 13 additions & 0 deletions src/H5FDsubfiling/H5FDioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,19 @@ H5FD__ioc_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
/* Retrieve the HDF5 stub file ID for the current file */
if (H5_subfiling_get_file_id_prop(plist_ptr, &file_ptr->file_id) < 0)
H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get stub file ID from FAPL");
if (file_ptr->file_id == UINT64_MAX) {
/* Since this VFD does no displaying of error stacks itself
* (it relies on the Subfiling VFD to do this), we must print
* the error stack here if we know it wasn't stacked under the
* Subfiling VFD.
*/
H5_SUBFILING_DONE_ERROR(
H5E_PLIST, H5E_BADVALUE, NULL,
"subfiling stub file ID property was missing from FAPL - IOC VFD wasn't correctly stacked under "
"the Subfiling VFD and cannot currently be used alone");
PRINT_ERROR_STACK;
goto done;
}

/*
* Open the subfiles for this HDF5 file. A subfiling
Expand Down
1 change: 1 addition & 0 deletions testpar/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ set (test_par_CLEANFILES
MPItest.h5
ShapeSameTest.h5
test_subfiling_basic_create.h5
test_subfiling_only_ioc_fail.h5
test_subfiling_config_file.h5
test_subfiling_stripe_sizes.h5
test_subfiling_selection_strategies.h5
Expand Down
41 changes: 41 additions & 0 deletions testpar/t_subfiling_vfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static hid_t create_subfiling_ioc_fapl(MPI_Comm comm, MPI_Info info, hbool_t cus

/* Test functions */
static void test_create_and_close(void);
static void test_ioc_only_fail(void);
static void test_config_file(void);
static void test_stripe_sizes(void);
static void test_selection_strategies(void);
Expand All @@ -102,6 +103,7 @@ static void test_subfiling_h5fuse(void);

static test_func tests[] = {
test_create_and_close,
test_ioc_only_fail,
test_config_file,
test_stripe_sizes,
test_selection_strategies,
Expand Down Expand Up @@ -218,6 +220,45 @@ test_create_and_close(void)
}
#undef SUBF_FILENAME

/*
* A simple test that ensures file creation fails when
* attempting to use the IOC VFD by itself, without it
* being stacked under the Subfiling VFD. This is
* currently unsupported.
*/
#define SUBF_FILENAME "test_subfiling_only_ioc_fail.h5"
static void
test_ioc_only_fail(void)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;

curr_nerrors = nerrors;

if (MAINPROCESS)
TESTING_2("invalid use of IOC VFD by itself");

/* Setup a FAPL using only the IOC VFD */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
VRFY((fapl_id >= 0), "H5Pcreate succeeded");

VRFY((H5Pset_mpi_params(fapl_id, comm_g, info_g) >= 0), "H5Pset_mpi_params succeeded");

VRFY((H5Pset_fapl_ioc(fapl_id, NULL) >= 0), "H5Pset_fapl_ioc succeeded");

H5E_BEGIN_TRY
{
file_id = H5Fcreate(SUBF_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
}
H5E_END_TRY;
VRFY((file_id < 0), "H5Fcreate failed successfully");

VRFY((H5Pclose(fapl_id) >= 0), "FAPL close succeeded");

CHECK_PASSED();
}
#undef SUBF_FILENAME

/*
* Test to check that Subfiling configuration file matches
* what is expected for a given configuration
Expand Down