diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index cec3b4a32259e81a6003bc282bd956ed691b2342..b8ae774629c05b073fce0920d38a9d056c9aec07 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1235,7 +1235,7 @@ sub command_line_setup () {
 # But a fairly safe range seems to be 5001 - 32767
 #
 
-sub set_mtr_build_thread_ports() {
+sub set_mtr_build_thread_ports($) {
   my $mtr_build_thread= shift;
 
   # Up to two masters, up to three slaves
diff --git a/mysql-test/r/synchronization.result b/mysql-test/r/synchronization.result
index 4543a82949442789a6162107ee9fea96d8bf81ab..5d8585f1f883776e224a0db6aa11c0bea1a96942 100644
--- a/mysql-test/r/synchronization.result
+++ b/mysql-test/r/synchronization.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
 CREATE TABLE t1 (x1 int);
 ALTER TABLE t1 CHANGE x1 x2 int;
 CREATE TABLE t2 LIKE t1;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index c21f36616675d069dc37035b4079fbb28c9b0d25..e48108af9cef87c76bec1c867531941b6284d062 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -30,6 +30,7 @@ rpl_ndb_myisam2ndb       : Bug #19710  Cluster replication to partition table fa
 rpl_row_blob_innodb      : BUG#18980 2006-04-10 kent    Test fails randomly
 rpl_sp                   : BUG#16456 2006-02-16 jmiller
 rpl_multi_engine         : BUG#22583 2006-09-23 lars
+synchronization          : Bug#24529  	Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit.
 
 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
 #ndb_binlog_ddl_multi     : BUG#18976 2006-04-10 kent    CRBR: multiple binlog, second binlog may miss schema log events
diff --git a/mysql-test/t/synchronization.test b/mysql-test/t/synchronization.test
index c7696195ee0275d65af09e759036498418716165..71e13a65ec3bd40ecc27039a5061bfac1da425ae 100644
--- a/mysql-test/t/synchronization.test
+++ b/mysql-test/t/synchronization.test
@@ -4,7 +4,7 @@
 #
 
 --disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
 --enable_warnings
 
 connect (con1,localhost,root,,);
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 79d79d41c340a0c70073eadb2e7aa61962f031a6..e115739b4213c19eb0690b43e0e2696ee8b7719c 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -20,7 +20,7 @@ MYSQLBASEdir=		$(prefix)
 INCLUDES =		@ZLIB_INCLUDES@ -I$(top_builddir)/include \
 			-I$(top_srcdir)/include -I$(srcdir)
 pkglib_LIBRARIES =	libmysys.a
-LDADD =			libmysys.a $(top_builddir)/strings/libmystrings.a
+LDADD =			libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug/libdbug.a
 noinst_HEADERS =	mysys_priv.h my_static.h
 libmysys_a_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
 			mf_path.c mf_loadpath.c my_file.c \
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index c55cc32b47d8f14f265758b4ce0e2c53510b6855..dbadc45ae9fafbc1e468976a0f60caac2434447a 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -276,7 +276,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
   if (!pthread_equal(pthread_self(),alarm_thread))
   {
 #if defined(MAIN) && !defined(__bsdi__)
-    printf("thread_alarm\n"); fflush(stdout);
+    printf("thread_alarm in process_alarm\n"); fflush(stdout);
 #endif
 #ifdef DONT_REMEMBER_SIGNAL
     my_sigset(THR_CLIENT_ALARM,process_alarm);	/* int. thread system calls */
@@ -848,8 +848,9 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
   MY_INIT(argv[0]);
 
   if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#')
+  {
     DBUG_PUSH(argv[1]+2);
-
+  }
   pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
   pthread_cond_init(&COND_thread_count,NULL);
 
@@ -917,8 +918,8 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
     }
   }
   pthread_mutex_unlock(&LOCK_thread_count);
-  end_thr_alarm(1);
   thr_alarm_info(&alarm_info);
+  end_thr_alarm(1);
   printf("Main_thread:  Alarms: %u  max_alarms: %u  next_alarm_time: %lu\n",
 	 alarm_info.active_alarms, alarm_info.max_used_alarms,
 	 alarm_info.next_alarm_time);