#At file:///home/marko/innobase/dev/mysql/5.1-innodb/ based on revid:marko.makela@stripped7e9uhxmhho
3439 Marko Mäkelä 2010-05-04
Add Valgrind checks to catch uninitialized writes to data files.
buf_flush_insert_into_flush_list(),
buf_flush_insert_sorted_into_flush_list(),
buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
modified:
storage/innodb_plugin/buf/buf0flu.c
=== modified file 'storage/innodb_plugin/buf/buf0flu.c'
--- a/storage/innodb_plugin/buf/buf0flu.c 2010-04-07 06:21:26 +0000
+++ b/storage/innodb_plugin/buf/buf0flu.c 2010-05-04 12:47:44 +0000
@@ -249,6 +249,17 @@ buf_flush_insert_into_flush_list(
ut_d(block->page.in_flush_list = TRUE);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page);
+#ifdef UNIV_DEBUG_VALGRIND
+ {
+ ulint zip_size = buf_block_get_zip_size(block);
+
+ if (UNIV_UNLIKELY(zip_size)) {
+ UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size);
+ } else {
+ UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE);
+ }
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(buf_flush_validate_low());
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
@@ -276,6 +287,18 @@ buf_flush_insert_sorted_into_flush_list(
ut_ad(!block->page.in_flush_list);
ut_d(block->page.in_flush_list = TRUE);
+#ifdef UNIV_DEBUG_VALGRIND
+ {
+ ulint zip_size = buf_block_get_zip_size(block);
+
+ if (UNIV_UNLIKELY(zip_size)) {
+ UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size);
+ } else {
+ UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE);
+ }
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
+
prev_b = NULL;
/* For the most part when this function is called the flush_rbt
@@ -809,6 +832,7 @@ try_again:
zip_size = buf_page_get_zip_size(bpage);
if (UNIV_UNLIKELY(zip_size)) {
+ UNIV_MEM_ASSERT_RW(bpage->zip.data, zip_size);
/* Copy the compressed page and clear the rest. */
memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free,
@@ -818,6 +842,8 @@ try_again:
+ zip_size, 0, UNIV_PAGE_SIZE - zip_size);
} else {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
+ UNIV_MEM_ASSERT_RW(((buf_block_t*) bpage)->frame,
+ UNIV_PAGE_SIZE);
memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free,
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100504124744-c1ivf5tm90nv7lc1.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-innodb branch (marko.makela:3439) | marko.makela | 4 May |