Commit 751934dd authored by marko's avatar marko

branches/zip: Improve Valgrind instrumentation.

page_zip_get_trailer_len(), page_zip_write_header(): Correct the
UNIV_MEM_ASSERT_RW() assertions.

page_zip_validate(): Read the validity bits of page, page_zip, and
page_zip->data.
parent 9df65876
...@@ -215,7 +215,7 @@ page_zip_get_trailer_len( ...@@ -215,7 +215,7 @@ page_zip_get_trailer_len(
ulint uncompressed_size; ulint uncompressed_size;
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_RW(page_zip, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
if (UNIV_UNLIKELY(!page_is_leaf(page_zip->data))) { if (UNIV_UNLIKELY(!page_is_leaf(page_zip->data))) {
uncompressed_size = PAGE_ZIP_DIR_SLOT_SIZE uncompressed_size = PAGE_ZIP_DIR_SLOT_SIZE
...@@ -356,7 +356,7 @@ page_zip_write_header( ...@@ -356,7 +356,7 @@ page_zip_write_header(
ut_ad(buf_frame_get_page_zip(str) == page_zip); ut_ad(buf_frame_get_page_zip(str) == page_zip);
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_RW(page_zip, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
pos = page_offset(str); pos = page_offset(str);
......
...@@ -2678,12 +2678,16 @@ page_zip_validate( ...@@ -2678,12 +2678,16 @@ page_zip_validate(
temp_page = ut_align(temp_page_buf, UNIV_PAGE_SIZE); temp_page = ut_align(temp_page_buf, UNIV_PAGE_SIZE);
#ifdef UNIV_DEBUG_VALGRIND #ifdef UNIV_DEBUG_VALGRIND
/* Get some more information if the UNIV_MEM_ASSERT_RW below fail. */ /* Get detailed information on the valid bits in case the
UNIV_MEM_ASSERT_RW() checks fail. */
VALGRIND_GET_VBITS(page, temp_page, UNIV_PAGE_SIZE); VALGRIND_GET_VBITS(page, temp_page, UNIV_PAGE_SIZE);
VALGRIND_GET_VBITS(page_zip, &temp_page_zip, sizeof temp_page_zip);
#endif /* UNIV_DEBUG_VALGRIND */
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE); UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
VALGRIND_GET_VBITS(page_zip, &temp_page_zip, sizeof temp_page_zip);
UNIV_MEM_ASSERT_RW(page_zip, sizeof *page_zip);
VALGRIND_GET_VBITS(page_zip->data, temp_page,
page_zip_get_size(page_zip));
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
#endif /* UNIV_DEBUG_VALGRIND */
temp_page_zip = *page_zip; temp_page_zip = *page_zip;
valid = page_zip_decompress(&temp_page_zip, temp_page); valid = page_zip_decompress(&temp_page_zip, temp_page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment