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 this is set to TRUE all threads will stop into the next assertion
19
ibool ut_dbg_stop_threads = FALSE;
21
ibool panic_shutdown = FALSE; /* This is set to TRUE when on NetWare there
22
happens an InnoDB assertion failure or other
23
fatal error condition that requires an
24
immediate shutdown. */
25
#else /* __NETWARE__ */
26
/* Null pointer used to generate memory trap */
28
ulint* ut_dbg_null_ptr = NULL;
29
#endif /* __NETWARE__ */
31
/*****************************************************************
32
Report a failed assertion. */
35
ut_dbg_assertion_failed(
36
/*====================*/
37
const char* expr, /* in: the failed assertion (optional) */
38
const char* file, /* in: source file containing the assertion */
39
ulint line) /* in: line number of the assertion */
41
ut_print_timestamp(stderr);
43
"InnoDB: Assertion failure in thread %lu"
44
" in file %s line %lu\n",
45
os_thread_pf(os_thread_get_curr_id()), file, line);
48
"InnoDB: Failing assertion: %s\n", expr);
52
"InnoDB: We intentionally generate a memory trap.\n"
53
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n"
54
"InnoDB: If you get repeated assertion failures or crashes, even\n"
55
"InnoDB: immediately after the mysqld startup, there may be\n"
56
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
57
"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
58
"InnoDB: about forcing recovery.\n", stderr);
59
ut_dbg_stop_threads = TRUE;
63
/*****************************************************************
64
Shut down MySQL/InnoDB after assertion failure. */
70
if (!panic_shutdown) {
71
panic_shutdown = TRUE;
72
innobase_shutdown_for_mysql();
76
#else /* __NETWARE__ */
77
/*****************************************************************
78
Stop a thread after assertion failure. */
86
fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n",
87
os_thread_pf(os_thread_get_curr_id()), file, line);
88
os_thread_sleep(1000000000);
90
#endif /* __NETWARE__ */