From 3d29cbb27fd6e9beeb3213b6ee3f7f6c7c5bc37d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 12 Mar 2020 13:21:11 -0700 Subject: Very minor comment change in H5VLconnector.h. --- src/H5VLconnector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 39d9b14..7951a32 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -194,7 +194,7 @@ typedef enum H5VL_object_get_t { H5VL_OBJECT_GET_FILE, /* object file */ H5VL_OBJECT_GET_NAME, /* object name */ H5VL_OBJECT_GET_TYPE, /* object type */ - H5VL_OBJECT_GET_INFO /* H5Oget_info(_by_idx|name)3 */ + H5VL_OBJECT_GET_INFO /* H5Oget_info(_by_idx|name) */ } H5VL_object_get_t; /* types for object SPECIFIC callback */ -- cgit v0.12 From 6be711bbd2b86de5bcd8f092d8f27d6b2251c111 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Mar 2020 15:31:27 -0500 Subject: Fix threadsafe for new test --- test/CMakeLists.txt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2594477..7929e2c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -287,7 +287,7 @@ set (H5_TESTS cache_logging cork swmr - thread_id + thread_id # special link vol ) @@ -310,6 +310,7 @@ set (H5_TESTS_MULTIPLE testhdf5 cache_image ttsafe + thread_id # special link ) # Only build single source tests here foreach (h5_test ${H5_TESTS}) @@ -389,6 +390,24 @@ else () endif () set_target_properties (ttsafe PROPERTIES FOLDER test) +######### Special handling for extra link lib of threads ############# +#-- Adding test for thread_id +add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c) +target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (thread_id STATIC) + target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET}) + if (NOT WIN32) + target_link_libraries (thread_id + PRIVATE $<$:Threads::Threads> + ) + endif () +else () + TARGET_C_PROPERTIES (thread_id SHARED) + target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$:Threads::Threads>) +endif () +set_target_properties (thread_id PROPERTIES FOLDER test) + ############################################################################## ### A D D I T I O N A L T E S T S ### ############################################################################## -- cgit v0.12 From 693008ecaff187a2551cfdf22fab618ff631658f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 18 Mar 2020 13:58:02 -0700 Subject: Fix shutdown errors when using the HDF5_VOL_CONNECTOR environment variable to set a dynamically loaded plugin as the default VOL connector. Fixes HDFFV-11057 --- release_docs/RELEASE.txt | 12 ++++++++++++ src/H5.c | 4 +++- src/H5VLint.c | 2 +- src/H5VLpassthru.c | 12 ++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ff024c3..77cd88b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -419,6 +419,18 @@ New Features (ADB - 2018/09/18, HDFFV-10332) + - Fix shutdown failure when using the HDF5_VOL_CONNECTOR environment variable + + When using the HDF5_VOL_CONNECTOR environment variable to set an + alternative default VOL connector, if the VOL connector is a dynamically + loaded plugin, the library can experience segmentation faults at when + the library is closed. This is due to the library unloading the plugins + before the virtual object layer. When then the VOL shutdown occurs, + it will attempt to close the default VOL connector, however this will + fail since the plugins will already have been unloaded. + + (DER - 2020/03/18, HDFFV-11057) + Parallel Library: ----------------- diff --git a/src/H5.c b/src/H5.c index 16c12cb..62a1c09 100644 --- a/src/H5.c +++ b/src/H5.c @@ -355,7 +355,9 @@ H5_term_library(void) pending += DOWN(Z); pending += DOWN(FD); pending += DOWN(VL); - pending += DOWN(PL); + /* Don't shut down the plugin code until all "pluggable" interfaces (Z, FD, PL) are shut down */ + if(pending == 0) + pending += DOWN(PL); /* Don't shut down the error code until other APIs which use it are shut down */ if(pending == 0) pending += DOWN(E); diff --git a/src/H5VLint.c b/src/H5VLint.c index 6572faa..861629f 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -273,7 +273,7 @@ H5VL_term_package(void) else { if(H5I_nmembers(H5I_VOL) > 0) { /* Unregister all VOL connectors */ - (void)H5I_clear_type(H5I_VOL, FALSE, FALSE); + (void)H5I_clear_type(H5I_VOL, TRUE, FALSE); n++; } /* end if */ else { diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 8b3dc62..2cf470e 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -1591,6 +1591,10 @@ H5VL_pass_through_file_create(const char *name, unsigned flags, hid_t fcpl_id, /* Get copy of our VOL info from FAPL */ H5Pget_vol_info(fapl_id, (void **)&info); + /* Make sure we have info about the underlying VOL to be used */ + if (!info) + return NULL; + /* Copy the FAPL */ under_fapl_id = H5Pcopy(fapl_id); @@ -1645,6 +1649,10 @@ H5VL_pass_through_file_open(const char *name, unsigned flags, hid_t fapl_id, /* Get copy of our VOL info from FAPL */ H5Pget_vol_info(fapl_id, (void **)&info); + /* Make sure we have info about the underlying VOL to be used */ + if (!info) + return NULL; + /* Copy the FAPL */ under_fapl_id = H5Pcopy(fapl_id); @@ -1785,6 +1793,10 @@ H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, /* Get copy of our VOL info from FAPL */ H5Pget_vol_info(fapl_id, (void **)&info); + /* Make sure we have info about the underlying VOL to be used */ + if (!info) + return (-1); + /* Copy the FAPL */ under_fapl_id = H5Pcopy(fapl_id); -- cgit v0.12 From ce7936d2b256bdd5e61a5ef018f35e9562667cac Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 18 Mar 2020 14:08:47 -0700 Subject: Fixed the RELEASE.txt note for HDFFV-11057 --- release_docs/RELEASE.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 77cd88b..c7a8e53 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -419,15 +419,14 @@ New Features (ADB - 2018/09/18, HDFFV-10332) - - Fix shutdown failure when using the HDF5_VOL_CONNECTOR environment variable - - When using the HDF5_VOL_CONNECTOR environment variable to set an - alternative default VOL connector, if the VOL connector is a dynamically - loaded plugin, the library can experience segmentation faults at when - the library is closed. This is due to the library unloading the plugins - before the virtual object layer. When then the VOL shutdown occurs, - it will attempt to close the default VOL connector, however this will - fail since the plugins will already have been unloaded. + - Fix shutdown failure when using H5VLregister_connector_by_name/value + + When using H5VLregister_connector_by_name/value to dynamically load a + VOL connector plugin, the library can experience segmentation faults + when the library is closed. This is due to the library unloading + the plugin interface before the virtual object layer. Then, when the + VOL shutdown occurs, it will attempt to close the VOL connector, + however this will fail since the plugin will already have been unloaded. (DER - 2020/03/18, HDFFV-11057) -- cgit v0.12