1
/*********************************************************************
2
Debug utilities for Innobase.
4
(c) 1994, 1995 Innobase Oy
6
Created 1/30/1994 Heikki Tuuri
7
**********************************************************************/
11
#if defined(__GNUC__) && (__GNUC__ > 2)
13
/* This is used to eliminate compiler warnings */
14
ulint ut_dbg_zero = 0;
17
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
18
/* If this is set to TRUE all threads will stop into the next assertion
20
ibool ut_dbg_stop_threads = FALSE;
22
#if !defined(UT_DBG_USE_ABORT)
23
/* Null pointer used to generate memory trap */
25
ulint* ut_dbg_null_ptr = NULL;
28
/*****************************************************************
29
Report a failed assertion. */
32
ut_dbg_assertion_failed(
33
/*====================*/
34
const char* expr, /* in: the failed assertion (optional) */
35
const char* file, /* in: source file containing the assertion */
36
ulint line) /* in: line number of the assertion */
38
ut_print_timestamp(stderr);
40
" InnoDB: Assertion failure in thread %lu"
41
" in file %s line %lu\n",
42
os_thread_pf(os_thread_get_curr_id()), file, line);
45
"InnoDB: Failing assertion: %s\n", expr);
48
fputs("InnoDB: We intentionally generate a memory trap.\n"
49
"InnoDB: Submit a detailed bug report"
50
" to http://bugs.mysql.com.\n"
51
"InnoDB: If you get repeated assertion failures"
53
"InnoDB: immediately after the mysqld startup, there may be\n"
54
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
55
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
56
"forcing-recovery.html\n"
57
"InnoDB: about forcing recovery.\n", stderr);
58
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
59
ut_dbg_stop_threads = TRUE;
63
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
64
/*****************************************************************
65
Stop a thread after assertion failure. */
73
fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n",
74
os_thread_pf(os_thread_get_curr_id()), file, line);
75
os_thread_sleep(1000000000);