summaryrefslogtreecommitdiffstats
path: root/src/H5B.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-04-05 15:45:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-04-05 15:45:49 (GMT)
commitb7f6a65f7458ba351a55206abcbdc89f3c721f4b (patch)
treefcdd4473bb27ce095bbbd4b421e9a09cb4fb4389 /src/H5B.c
parent935f20f142196edd6272d4621cf41ad817677da1 (diff)
downloadhdf5-b7f6a65f7458ba351a55206abcbdc89f3c721f4b.zip
hdf5-b7f6a65f7458ba351a55206abcbdc89f3c721f4b.tar.gz
hdf5-b7f6a65f7458ba351a55206abcbdc89f3c721f4b.tar.bz2
[svn-r14798] Description:
Correctly initialize cache_info struct for cloned B-tree node (correcting memory corruption issue on Linux machines) Remove "//" comments in cache2_common.c and replace them with "/* *" comments. Back out h5diff hack in testh5recover.sh.in, Albert already fixed it. Still building on tg-login3 for parallel testing... Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.5.2 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5B.c')
-rw-r--r--src/H5B.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/H5B.c b/src/H5B.c
index 4b9d26c..b32a515 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -228,7 +228,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata,
*/
if (NULL==(bt = H5FL_MALLOC(H5B_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree root node")
- HDmemset(&bt->cache_info,0,sizeof(H5AC2_info_t));
+ HDmemset(&bt->cache_info, 0, sizeof(H5AC2_info_t));
bt->level = 0;
bt->left = HADDR_UNDEF;
bt->right = HADDR_UNDEF;
@@ -1865,7 +1865,10 @@ H5B_copy(const H5B_t *old_bt)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node")
/* Copy the main structure */
- HDmemcpy(new_node,old_bt,sizeof(H5B_t));
+ HDmemcpy(new_node, old_bt, sizeof(H5B_t));
+
+ /* Reset cache info */
+ HDmemset(&new_node->cache_info, 0, sizeof(H5AC2_info_t));
if ( NULL==(new_node->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))