[Commits] Rev 3021: Fixed bugs found by buildbot: in lp:maria/5.1

Michael Widenius monty at askmonty.org
Wed Jan 26 15:17:47 EET 2011


At lp:maria/5.1

------------------------------------------------------------
revno: 3021
revision-id: monty at askmonty.org-20110126131746-qnivnq4vbs00q72v
parent: monty at askmonty.org-20110124131940-6xh22if0cehedvbf
committer: Michael Widenius <monty at askmonty.org>
branch nick: maria-5.1
timestamp: Wed 2011-01-26 15:17:46 +0200
message:
  Fixed bugs found by buildbot:
  - Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
  - Fixed compiler warnings
  - Added a name for each thr_lock to get better error messages (This is needed to find out why 'archive.test' sometimes fails)
-------------- next part --------------
=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh	2010-11-24 22:57:34 +0000
+++ b/BUILD/SETUP.sh	2011-01-26 13:17:46 +0000
@@ -98,7 +98,7 @@ SSL_LIBRARY=--with-ssl
 
 if [ "x$warning_mode" != "xpedantic" ]; then
 # Both C and C++ warnings
-  warnings="-Wall -Wextra -Wunused -Wwrite-strings"
+  warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized"
 
 # For more warnings, uncomment the following line
 # warnings="$warnings -Wshadow"
@@ -112,7 +112,7 @@ if [ "x$warning_mode" != "xpedantic" ];
 # Added unless --with-debug=full
   debug_extra_cflags="-O0 -g3 -gdwarf-2"
 else
-  warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
+  warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -Wno-uninitialized -D_POSIX_SOURCE"
   c_warnings="$warnings"
   cxx_warnings="$warnings -std=c++98"
 # NOTE: warning mode should not influence optimize/debug mode.
@@ -127,12 +127,14 @@ fi
 # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
 # LINT_INIT(), which is only useful for silencing spurious warnings
 # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
-valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
+valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
+valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
 valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
 valgrind_configs="--with-valgrind"
 #
 # Used in -debug builds
-debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
+debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
+debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
 debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
 error_inject="--with-error-inject "
 #

=== modified file 'BUILD/build_mccge.sh'
--- a/BUILD/build_mccge.sh	2010-11-23 21:39:59 +0000
+++ b/BUILD/build_mccge.sh	2011-01-26 13:17:46 +0000
@@ -1063,7 +1063,7 @@ set_warning_flags()
       warnings="$warnings -Wcomment -W"
       warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
       warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label"
-      warnings="$warnings -Wunused-value -Wunused-variable"
+      warnings="$warnings -Wunused-value -Wunused-variable -Wno-uninitialized"
 
       if test "x$warning_mode" = "extra" ; then
         warnings="$warnings -Wshadow"
@@ -1094,7 +1094,8 @@ set_with_debug_flags()
 {
   if test "x$with_debug_flag" = "xyes" ; then
     if test "x$developer_flag" = "xyes" ; then
-      loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
+      loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
+      loc_debug_flags="$loc_debug_flags -Wuninitialized -DFORCE_INIT_OF_VARS"
       loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
       compiler_flags="$compiler_flags $loc_debug_flags"
     fi

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-11-24 22:57:34 +0000
+++ b/client/mysqltest.cc	2011-01-26 13:17:46 +0000
@@ -3071,8 +3071,7 @@ void do_remove_files_wildcard(struct st_
     if (ds_wild.length &&
         wild_compare(file->name, ds_wild.str, 0))
       continue;
-    ds_file_to_remove.length= ds_directory.length + 1;
-    ds_file_to_remove.str[ds_directory.length + 1]= 0;
+    ds_file_to_remove.length= ds_directory.length;
     dynstr_append(&ds_file_to_remove, file->name);
     DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
     if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))

=== modified file 'extra/libevent/devpoll.c'
--- a/extra/libevent/devpoll.c	2010-01-28 11:35:10 +0000
+++ b/extra/libevent/devpoll.c	2011-01-26 13:17:46 +0000
@@ -185,7 +185,7 @@ devpoll_init(struct event_base *base)
 }
 
 static int
-devpoll_recalc(struct event_base *base, void *arg, int max)
+devpoll_recalc(struct event_base *base __attribute__((unused)), void *arg, int max)
 {
         struct devpollop *devpollop = arg;
 

=== modified file 'include/thr_lock.h'
--- a/include/thr_lock.h	2010-11-02 15:22:57 +0000
+++ b/include/thr_lock.h	2011-01-26 13:17:46 +0000
@@ -123,7 +123,7 @@ typedef struct st_thr_lock_data {
   struct st_thr_lock *lock;
   pthread_cond_t *cond;
   void *status_param;                   /* Param to status functions */
-  void *debug_print_param;
+  void *debug_print_param;              /* Used by MariaDB for TABLE ref */
   enum thr_lock_type type;
   uint priority;
 } THR_LOCK_DATA;
@@ -149,6 +149,7 @@ typedef struct st_thr_lock {
   my_bool (*start_trans)(void*);        /* When all locks are taken */
   my_bool (*check_status)(void *);
   void   (*fix_status)(void *, void *);/* For thr_merge_locks() */
+  const char *name;                     /* Used for error reporting */
   my_bool allow_multiple_concurrent_insert;
 } THR_LOCK;
 

=== modified file 'mysql-test/suite/maria/t/maria3.test'
--- a/mysql-test/suite/maria/t/maria3.test	2010-06-13 22:13:32 +0000
+++ b/mysql-test/suite/maria/t/maria3.test	2011-01-26 13:17:46 +0000
@@ -172,11 +172,13 @@ create table t1 (a bigint auto_increment
 let $1=1000;
 --disable_query_log
 --disable_warnings
+lock tables t1 write;
 while ($1)
 {
   insert into t1 () values();
   dec $1;
 }
+unlock tables;
 --enable_query_log
 update t1 set b=repeat('a',100) where a between 1 and 100;
 check table t1;

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2010-08-02 09:01:24 +0000
+++ b/mysql-test/valgrind.supp	2011-01-26 13:17:46 +0000
@@ -489,6 +489,21 @@
 }
 
 {
+   dlsym memory loss from plugin on SuSE 11.1 x64
+   Memcheck:Leak
+   fun:*alloc
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
+   obj:/lib*/libdl-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libdl-*.so
+   fun:dlsym
+   fun:*plugin_dl_add*
+}
+
+{
    dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 32/64 bit ver 1
    Memcheck:Leak
    fun:*alloc

=== modified file 'mysys/thr_lock.c'
--- a/mysys/thr_lock.c	2010-12-13 13:27:13 +0000
+++ b/mysys/thr_lock.c	2011-01-26 13:17:46 +0000
@@ -182,8 +182,10 @@ static int check_lock(struct st_lock_lis
           last_lock_type != TL_WRITE_CONCURRENT_INSERT)
       {
         fprintf(stderr,
-                "Warning: Found locks from different threads in %s at '%s'.  org_lock_type: %d  last_lock_type: %d  new_lock_type: %d\n",
-                lock_type, where, list->data->type, last_lock_type, data->type);
+                "Warning: Found locks from different threads for lock '%s' in '%s' at '%s'.  org_lock_type: %d  last_lock_type: %d  new_lock_type: %d\n",
+                data->lock->name ? data->lock->name : "",
+                lock_type, where, list->data->type, last_lock_type,
+                data->type);
         return 1;
       }
       if (no_cond && data->cond)
@@ -405,6 +407,7 @@ void thr_lock_data_init(THR_LOCK *lock,T
   data->status_param=param;
   data->cond=0;
   data->priority= 0;
+  data->debug_print_param= 0;
 }
 
 
@@ -879,6 +882,7 @@ void thr_unlock(THR_LOCK_DATA *data, uin
   data->type=TL_UNLOCK;                         /* Mark unlocked */
   check_locks(lock,"after releasing lock",1);
   wake_up_waiters(lock);
+  check_locks(lock,"end of thr_unlock",1);
   pthread_mutex_unlock(&lock->mutex);
   DBUG_VOID_RETURN;
 }

=== modified file 'sql/lock.cc'
--- a/sql/lock.cc	2010-11-24 22:57:34 +0000
+++ b/sql/lock.cc	2011-01-26 13:17:46 +0000
@@ -923,7 +923,10 @@ static MYSQL_LOCK *get_lock_data(THD *th
     *to++= table;
     if (locks)
       for ( ; org_locks != locks ; org_locks++)
+      {
         (*org_locks)->debug_print_param= (void *) table;
+        (*org_locks)->lock->name=         table->alias;
+      }
   }
   /*
     We do not use 'tables', because there are cases where store_lock()

=== modified file 'storage/xtradb/fil/fil0fil.c'
--- a/storage/xtradb/fil/fil0fil.c	2010-10-19 12:16:15 +0000
+++ b/storage/xtradb/fil/fil0fil.c	2011-01-26 13:17:46 +0000
@@ -3313,7 +3313,7 @@ fil_open_single_table_tablespace(
                                 }
 
                                 if (page_is_corrupt) {
-                                        fprintf(stderr, " [errp:%lld]", offset / UNIV_PAGE_SIZE);
+                                  fprintf(stderr, " [errp:%ld]", (long) (offset / UNIV_PAGE_SIZE));
 
                                         /* cannot treat corrupt page */
                                         goto skip_write;



More information about the commits mailing list