summaryrefslogtreecommitdiffstats
path: root/src/H5Odbg.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2012-03-15 19:16:24 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2012-03-15 19:16:24 (GMT)
commit3ee8b91dee10390a31d60fb6578b7e874060a50e (patch)
treef5423bd673c4b99eea985cd5888796ad71788acc /src/H5Odbg.c
parentd849a118c28f7bcb57798c1222b539adeb8dbe2b (diff)
downloadhdf5-3ee8b91dee10390a31d60fb6578b7e874060a50e.zip
hdf5-3ee8b91dee10390a31d60fb6578b7e874060a50e.tar.gz
hdf5-3ee8b91dee10390a31d60fb6578b7e874060a50e.tar.bz2
[svn-r22072] Purpose: Fix rare corruption bug (HDFFV-7879)
Description: When using the new object header format, it was possible for corruption to occur if the first object header chunk changed size such that the lenght of the "chunk 0 size" field changed. This only occurred if there were messages that had not been decoded. The original algorithm that changed the object header chunk size marked all messages as dirty, causing those that had not been decoded to have both the raw and native form invalidated. Changed the algorithm to avoid marking messages dirty and added assertions to catch the case where messages are dirtied without being decoded (or recently created) first. Tested: jam, koala, ostrich (h5committest), durandal
Diffstat (limited to 'src/H5Odbg.c')
-rw-r--r--src/H5Odbg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index ce8b870..5c07b64 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -167,6 +167,8 @@ H5O_assert(const H5O_t *oh)
H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native;
hbool_t found_chunk = FALSE; /* Found a chunk that matches */
+ HDassert(cont);
+
/* Increment # of continuation messages found */
cont_msgs_found++;
@@ -186,6 +188,9 @@ H5O_assert(const H5O_t *oh)
else {
meta_space += (size_t)H5O_SIZEOF_MSGHDR_OH(oh);
mesg_space += curr_msg->raw_size;
+
+ /* Make sure the message has a native form if it is marked dirty */
+ HDassert(curr_msg->native || !curr_msg->dirty);
} /* end else */
/* Make certain that the message is in a valid chunk */