summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-02 13:28:53 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-02 13:28:53 (GMT)
commit28b16f19b2d75e6d792f14ecb139c710f70289fe (patch)
tree19b9333135ce74be4551029a5478f70ca03b0261 /src
parente25aa5f97d7605efb07b303eeba10d4a8a34485d (diff)
downloadhdf5-28b16f19b2d75e6d792f14ecb139c710f70289fe.zip
hdf5-28b16f19b2d75e6d792f14ecb139c710f70289fe.tar.gz
hdf5-28b16f19b2d75e6d792f14ecb139c710f70289fe.tar.bz2
[svn-r29032] capture the entry address before the entry is freed to avoid
triggering a segfault in the log_flush call in H5C__flush_single_entry(). tested on Jam with Parallel.
Diffstat (limited to 'src')
-rw-r--r--src/H5C.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5C.c b/src/H5C.c
index 641e098..ac786b5 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -7549,6 +7549,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
hbool_t was_dirty;
haddr_t new_addr = HADDR_UNDEF;
haddr_t old_addr = HADDR_UNDEF;
+ haddr_t entry_addr = HADDR_UNDEF;
size_t new_len = 0;
size_t new_compressed_len = 0;
herr_t ret_value = SUCCEED; /* Return value */
@@ -8019,6 +8020,10 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
/* reset the flush_in progress flag */
entry_ptr->flush_in_progress = FALSE;
+ /* capture the cache entry address for the log_flush call at the
+ end before the entry_ptr gets freed */
+ entry_addr = entry_ptr->addr;
+
/* Internal cache data structures should now be up to date, and
* consistant with the status of the entry.
*
@@ -8130,7 +8135,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
} /* if (destroy) */
if(cache_ptr->log_flush)
- if((cache_ptr->log_flush)(cache_ptr, entry_ptr->addr, was_dirty, flags) < 0)
+ if((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed.")
done: