From 33cf994614492333c66ffe7e4b3cdd2c2f1eda88 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 27 Jul 2004 15:41:59 -0500 Subject: [svn-r8959] Purpose: Bug fix Description: Always write fill values to chunks when initializing entire B-tree and any filters are defined. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Solaris 2.7 (arabica) Too minor to require h5committest --- release_docs/RELEASE.txt | 4 ++ src/H5Distore.c | 4 +- test/tmisc.c | 161 +++++++++++++++++++++++++++++++---------------- 3 files changed, 114 insertions(+), 55 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a04f360..22eae7a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -101,6 +101,10 @@ Bug Fixes since HDF5-1.6.2 release Library ------- + - Fixed bug where chunked datasets which have filters defined, + allocation time set to "late" and whose chunks don't align with + the dataspace bounds could have incorrect data stored when + overwriting the entire dataset on the first write. QAK - 2004/07/27 - Fixed bug in H5Sset_extent_simple where setting maximum size to non-zero, then to zero would cause an error. JML - 2004/07/20 - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite diff --git a/src/H5Distore.c b/src/H5Distore.c index 7e3c73a..73b7dc7 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -2426,10 +2426,12 @@ H5D_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, /* If we are filling the dataset on allocation or "if set" and * the fill value _is_ set, _and_ we are not overwriting the new blocks, + * or if there are any pipeline filters defined, * set the "should fill" flag */ - if(!full_overwrite && (fill_time==H5D_FILL_TIME_ALLOC || + if((!full_overwrite && (fill_time==H5D_FILL_TIME_ALLOC || (fill_time==H5D_FILL_TIME_IFSET && fill_status==H5D_FILL_VALUE_USER_DEFINED))) + || pline.nused>0) should_fill=1; /* Check if fill values should be written to blocks */ diff --git a/test/tmisc.c b/test/tmisc.c index acc12c2..00153c7 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -234,6 +234,15 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC20_SPACE2_DIM0 8 #define MISC20_SPACE2_DIM1 4 +/* Definitions for misc. test #21 */ +#define MISC21_FILE "tmisc21.h5" +#define MISC21_DSET_NAME "Dataset" +#define MISC21_SPACE_RANK 2 +#define MISC21_SPACE_DIM0 7639 +#define MISC21_SPACE_DIM1 6308 +#define MISC21_CHUNK_DIM0 1024 +#define MISC21_CHUNK_DIM1 1024 + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -589,12 +598,10 @@ test_misc4(void) VERIFY(stat1.fileno[1],stat2.fileno[1],"H5Gget_objinfo"); /* Verify that the fileno values are not the same between file1 & file2 */ - if(stat1.fileno[0]==stat3.fileno[0] && stat1.fileno[1]==stat3.fileno[1]) { + if(stat1.fileno[0]==stat3.fileno[0] && stat1.fileno[1]==stat3.fileno[1]) TestErrPrintf("Error on line %d: stat1.fileno==stat3.fileno\n",__LINE__); - } /* end if */ - if(stat2.fileno[0]==stat3.fileno[0] && stat2.fileno[1]==stat3.fileno[1]) { + if(stat2.fileno[0]==stat3.fileno[0] && stat2.fileno[1]==stat3.fileno[1]) TestErrPrintf("Error on line %d: stat1.fileno==stat3.fileno\n",__LINE__); - } /* end if */ /* Close the objects */ ret = H5Gclose(group1); @@ -1458,13 +1465,11 @@ test_misc8(void) storage_size=H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #endif /* H5_HAVE_FILTER_DEFLATE */ /* Close dataset ID */ @@ -1492,13 +1497,11 @@ test_misc8(void) storage_size=H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #endif /* H5_HAVE_FILTER_DEFLATE */ /* Write entire dataset */ @@ -1515,22 +1518,19 @@ test_misc8(void) tdata2=rdata; for(u=0; u=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #else - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #endif /*H5_HAVE_FILTER_DEFLATE*/ /* Close dataset ID */ @@ -1557,13 +1557,11 @@ test_misc8(void) storage_size=H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size>=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #else /* Compression is not configured */ - if(storage_size!=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size!=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #endif /* H5_HAVE_FILTER_DEFLATE */ /* Write entire dataset */ @@ -1580,22 +1578,19 @@ test_misc8(void) tdata2=rdata; for(u=0; u=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #else - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) { + if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); - } #endif /*H5_HAVE_FILTER_DEFLATE*/ /* Close dataset ID */ @@ -1977,13 +1972,11 @@ test_misc12(void) CHECK(ret, FAIL, "H5Dread"); for(i=0; i