[Commits] Rev 3127: backport a change from 5.5 to remove thread sleeps from Innodb assertions on Windows. in file:///H:/bzr/5.2/

Vladislav Vaintroub wlad at montyprogram.com
Tue Apr 17 00:31:27 EEST 2012


At file:///H:/bzr/5.2/

------------------------------------------------------------
revno: 3127
revision-id: wlad at montyprogram.com-20120416213102-ed3kbuvjcumjf609
parent: wlad at montyprogram.com-20120416132833-kjz2qqldkck8vgee
committer: Vladislav Vaintroub <wlad at montyprogram.com>
branch nick: 5.2
timestamp: Mon 2012-04-16 23:31:02 +0200
message:
  backport a change from 5.5 to remove thread sleeps from Innodb assertions on Windows.
  This can result in bad deadlocks (e.g loader lock), seen in latest crash reports.
-------------- next part --------------
=== modified file 'storage/innodb_plugin/include/ut0dbg.h'
--- a/storage/innodb_plugin/include/ut0dbg.h	2009-05-26 12:28:49 +0000
+++ b/storage/innodb_plugin/include/ut0dbg.h	2012-04-16 21:31:02 +0000
@@ -54,27 +54,14 @@
 	const char* file,	/*!< in: source file containing the assertion */
 	ulint line);		/*!< in: line number of the assertion */
 
-#ifdef __NETWARE__
-/** Flag for ignoring further assertion failures.  This is set to TRUE
-when on NetWare there happens an InnoDB assertion failure or other
-fatal error condition that requires an immediate shutdown. */
-extern ibool	panic_shutdown;
-/* Abort the execution. */
-void ut_dbg_panic(void);
-# define UT_DBG_PANIC ut_dbg_panic()
-/* Stop threads in ut_a(). */
-# define UT_DBG_STOP	do {} while (0)	/* We do not do this on NetWare */
-#else /* __NETWARE__ */
-# if defined(__WIN__) || defined(__INTEL_COMPILER)
-#  undef UT_DBG_USE_ABORT
-# elif defined(__GNUC__) && (__GNUC__ > 2)
-#  define UT_DBG_USE_ABORT
-# endif
-
-# ifndef UT_DBG_USE_ABORT
+
+#define UT_DBG_USE_ABORT
+
+
+#ifndef UT_DBG_USE_ABORT
 /** A null pointer that will be dereferenced to trigger a memory trap */
 extern ulint*	ut_dbg_null_ptr;
-# endif
+#endif
 
 # if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
 /** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
@@ -91,9 +78,14 @@
 	ulint		line);
 # endif
 
-# ifdef UT_DBG_USE_ABORT
+
+#ifdef UT_DBG_USE_ABORT
 /** Abort the execution. */
-#  define UT_DBG_PANIC abort()
+#ifdef _WIN32
+# define UT_DBG_PANIC __debugbreak()
+#else
+# define UT_DBG_PANIC abort()
+#endif
 /** Stop threads (null operation) */
 #  define UT_DBG_STOP do {} while (0)
 # else /* UT_DBG_USE_ABORT */
@@ -106,7 +98,7 @@
 		ut_dbg_stop_thread(__FILE__, (ulint) __LINE__);	\
 	} while (0)
 # endif /* UT_DBG_USE_ABORT */
-#endif /* __NETWARE__ */
+
 
 /** Abort execution if EXPR does not evaluate to nonzero.
 @param EXPR	assertion expression that should hold */

=== modified file 'storage/xtradb/include/ut0dbg.h'
--- a/storage/xtradb/include/ut0dbg.h	2009-09-07 10:22:53 +0000
+++ b/storage/xtradb/include/ut0dbg.h	2012-04-16 21:31:02 +0000
@@ -54,27 +54,14 @@
 	const char* file,	/*!< in: source file containing the assertion */
 	ulint line);		/*!< in: line number of the assertion */
 
-#ifdef __NETWARE__
-/** Flag for ignoring further assertion failures.  This is set to TRUE
-when on NetWare there happens an InnoDB assertion failure or other
-fatal error condition that requires an immediate shutdown. */
-extern ibool	panic_shutdown;
-/* Abort the execution. */
-void ut_dbg_panic(void);
-# define UT_DBG_PANIC ut_dbg_panic()
-/* Stop threads in ut_a(). */
-# define UT_DBG_STOP	do {} while (0)	/* We do not do this on NetWare */
-#else /* __NETWARE__ */
-# if defined(__WIN__) || defined(__INTEL_COMPILER)
-#  undef UT_DBG_USE_ABORT
-# elif defined(__GNUC__) && (__GNUC__ > 2)
-#  define UT_DBG_USE_ABORT
-# endif
-
-# ifndef UT_DBG_USE_ABORT
+
+#define UT_DBG_USE_ABORT
+
+
+#ifndef UT_DBG_USE_ABORT
 /** A null pointer that will be dereferenced to trigger a memory trap */
 extern ulint*	ut_dbg_null_ptr;
-# endif
+#endif
 
 # if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
 /** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
@@ -91,9 +78,14 @@
 	ulint		line);
 # endif
 
-# ifdef UT_DBG_USE_ABORT
+
+#ifdef UT_DBG_USE_ABORT
 /** Abort the execution. */
-#  define UT_DBG_PANIC abort()
+#ifdef _WIN32
+# define UT_DBG_PANIC __debugbreak()
+#else
+# define UT_DBG_PANIC abort()
+#endif
 /** Stop threads (null operation) */
 #  define UT_DBG_STOP do {} while (0)
 # else /* UT_DBG_USE_ABORT */
@@ -106,7 +98,7 @@
 		ut_dbg_stop_thread(__FILE__, (ulint) __LINE__);	\
 	} while (0)
 # endif /* UT_DBG_USE_ABORT */
-#endif /* __NETWARE__ */
+
 
 /** Abort execution if EXPR does not evaluate to nonzero.
 @param EXPR	assertion expression that should hold */



More information about the commits mailing list