List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:February 10 2011 3:28pm
Subject:bzr push into mysql-5.1-innodb branch (vasil.dimov:3705 to 3706) Bug#59307
View as plain text  
 3706 Vasil Dimov	2011-02-10
      Fix Bug#59307 Valgrind: uninitialized value in rw_lock_set_writer_id_and_recursion_flag()
      
      by silencing a bogus Valgrind warning:
      
      ==4392== Conditional jump or move depends on uninitialised value(s)
      ==4392==    at 0x5A18416: rw_lock_set_writer_id_and_recursion_flag (sync0rw.ic:283)
      ==4392==    by 0x5A1865C: rw_lock_x_lock_low (sync0rw.c:558)
      ==4392==    by 0x5A18481: rw_lock_x_lock_func (sync0rw.c:617)
      ==4392==    by 0x597EEE6: mtr_x_lock_func (mtr0mtr.ic:271)
      ==4392==    by 0x597EBBD: fsp_header_init (fsp0fsp.c:970)
      ==4392==    by 0x5A15E78: innobase_start_or_create_for_mysql (srv0start.c:1508)
      ==4392==    by 0x598B789: innobase_init(void*) (ha_innodb.cc:2282)
      
      os_compare_and_swap_thread_id() is defined as
      __sync_bool_compare_and_swap(). From the GCC doc:
      
      `bool __sync_bool_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)'
        ...
        The "bool" version returns true if the comparison is successful and
        NEWVAL was written.
      
      So it is not possible that the return value is uninitialized, no matter what
      the arguments to os_compare_and_swap_thread_id() are. Probably Valgrind gets
      confused by the implementation of the GCC internal function
      __sync_bool_compare_and_swap().

    modified:
      storage/innodb_plugin/include/sync0rw.ic
 3705 Vasil Dimov	2011-02-10
      Increment InnoDB Plugin version from 1.0.15 to 1.0.16.
      InnoDB Plugin 1.0.15 has been released with MySQL 5.1.55.

    modified:
      storage/innodb_plugin/include/univ.i
=== modified file 'storage/innodb_plugin/include/sync0rw.ic'
--- a/storage/innodb_plugin/include/sync0rw.ic	revid:vasil.dimov@stripped
+++ b/storage/innodb_plugin/include/sync0rw.ic	revid:vasil.dimov@stripped
@@ -280,6 +280,7 @@ rw_lock_set_writer_id_and_recursion_flag
 	local_thread = lock->writer_thread;
 	success = os_compare_and_swap_thread_id(
 		&lock->writer_thread, local_thread, curr_thread);
+	UNIV_MEM_VALID(&success, sizeof(success));
 	ut_a(success);
 	lock->recursive = recursive;
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-innodb branch (vasil.dimov:3705 to 3706) Bug#59307vasil.dimov10 Feb