2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-12 17:31:09 +08:00

[svn-r2861] Purpose:

Bug fix.
Description:
    When writing data and the dataset needed to be extended, the write call
    ended up using the old dataspace extents (prior to the dataspace extend)
    and bad parameters would get into the I/O channel, eventually causing it
    to dump core.
Solution:
    Every time a dataset is extended, throw away the previous dataspace
    information and re-retrieve it.
Platforms tested:
    FreeBSD 4.1.1 (hawkwind)
This commit is contained in:
Quincey Koziol 2000-11-10 17:26:53 -05:00
parent 169579ee4d
commit 3886559829

@ -764,6 +764,15 @@ H5RA_write(H5RA_t *ra, hssize_t start_row, hsize_t nrows, H5T_t *type,
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to extend raw dataset");
}
/* Throw away previous raw file dataspace */
H5S_close(rf_space);
/* Retrieve newly extended raw file dataspace */
if (NULL==(rf_space=H5D_get_space(ra->raw)) ||
H5S_get_simple_extent_dims(rf_space, raw_cur_size, NULL)<0) {
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to determine current raw data extents");
}
}
hs_offset[0] = start_row;
hs_offset[1] = 0;
@ -798,6 +807,15 @@ H5RA_write(H5RA_t *ra, hssize_t start_row, hsize_t nrows, H5T_t *type,
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to extend meta dataset");
}
/* Throw away previous meta file dataspace */
H5S_close(mf_space);
/* Retrieve newly extended meta file dataspace */
if (NULL==(mf_space=H5D_get_space(ra->meta)) ||
H5S_get_simple_extent_dims(mf_space, &meta_cur_size, NULL)<0) {
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to determine current raw data extents");
}
}
if (H5S_set_extent_simple(mm_space, 1, &nrows, NULL)<0 ||
H5S_select_hyperslab(mf_space, H5S_SELECT_SET, &start_row, NULL,
@ -891,6 +909,15 @@ H5RA_fix_overflow(H5RA_t *ra, H5T_t *type, H5RA_meta_t *meta, hsize_t nelmts,
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to extend overflow dataset");
}
/* Throw away previous overflow file dataspace */
H5S_close(of_space);
/* Retrieve newly extended overflow file dataspace */
if (NULL==(of_space=H5D_get_space(ra->over)) ||
H5S_get_simple_extent_dims(of_space, &cur_size, NULL)<0) {
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to determine current overflow data extents");
}
#endif
} else {
@ -908,6 +935,15 @@ H5RA_fix_overflow(H5RA_t *ra, H5T_t *type, H5RA_meta_t *meta, hsize_t nelmts,
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to extend overflow dataset");
}
/* Throw away previous overflow file dataspace */
H5S_close(of_space);
/* Retrieve newly extended overflow file dataspace */
if (NULL==(of_space=H5D_get_space(ra->over)) ||
H5S_get_simple_extent_dims(of_space, &cur_size, NULL)<0) {
HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
"unable to determine current overflow data extents");
}
}
/* Write the data */