It turns out that the chunksize used in the
ncio-related code must be a multiple of eight in
size.  Both memio.c and mmapio.c were
potentially violating this constraint.

See also pr https://github.com/Unidata/netcdf-c/pull/400
This commit is contained in:
Dennis Heimbigner 2017-05-02 21:22:54 -06:00
parent 8dddd222a3
commit 6dc6cf65ba
2 changed files with 8 additions and 0 deletions

View File

@ -385,6 +385,10 @@ fprintf(stderr,"memio_open: initial memory: %lu/%lu\n",(unsigned long)memio->mem
/* Use half the filesize as the blocksize ; why? */
sizehint = filesize/2;
/* sizehint must be multiple of 8 */
sizehint = (sizehint / 8) * 8;
if(sizehint < 8) sizehint = 8;
fd = nc__pseudofd();
*((int* )&nciop->fd) = fd;

View File

@ -373,6 +373,10 @@ fprintf(stderr,"mmapio_open: initial memory: %lu/%lu\n",(unsigned long)mmapio->m
/* Use half the filesize as the blocksize */
sizehint = filesize/2;
/* sizehint must be multiple of 8 */
sizehint = (sizehint / 8) * 8;
if(sizehint < 8) sizehint = 8;
fd = nc__pseudofd();
*((int* )&nciop->fd) = fd;