| 1 | /***************************************************************************** |
| 2 | |
| 3 | Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. |
| 4 | Copyright (c) 2017, 2018, MariaDB Corporation. |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify it under |
| 7 | the terms of the GNU General Public License as published by the Free Software |
| 8 | Foundation; version 2 of the License. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, but WITHOUT |
| 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 12 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License along with |
| 15 | this program; if not, write to the Free Software Foundation, Inc., |
| 16 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
| 17 | |
| 18 | *****************************************************************************/ |
| 19 | |
| 20 | /*****************************************************************//** |
| 21 | @file ut/ut0dbg.cc |
| 22 | Debug utilities for Innobase. |
| 23 | |
| 24 | Created 1/30/1994 Heikki Tuuri |
| 25 | **********************************************************************/ |
| 26 | |
| 27 | #include "ha_prototypes.h" |
| 28 | |
| 29 | #include "ut0dbg.h" |
| 30 | |
| 31 | /*************************************************************//** |
| 32 | Report a failed assertion. */ |
| 33 | ATTRIBUTE_NORETURN |
| 34 | void |
| 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 | unsigned line) /*!< in: line number of the assertion */ |
| 40 | { |
| 41 | ut_print_timestamp(stderr); |
| 42 | fprintf(stderr, " InnoDB: Assertion failure in file %s line %u\n" , |
| 43 | file, line); |
| 44 | if (expr) { |
| 45 | fprintf(stderr, |
| 46 | "InnoDB: Failing assertion: %s\n" , expr); |
| 47 | } |
| 48 | |
| 49 | fputs("InnoDB: We intentionally generate a memory trap.\n" |
| 50 | "InnoDB: Submit a detailed bug report" |
| 51 | " to https://jira.mariadb.org/\n" |
| 52 | "InnoDB: If you get repeated assertion failures" |
| 53 | " or crashes, even\n" |
| 54 | "InnoDB: immediately after the mysqld startup, there may be\n" |
| 55 | "InnoDB: corruption in the InnoDB tablespace. Please refer to\n" |
| 56 | "InnoDB: https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/\n" |
| 57 | "InnoDB: about forcing recovery.\n" , stderr); |
| 58 | |
| 59 | fflush(stderr); |
| 60 | fflush(stdout); |
| 61 | abort(); |
| 62 | } |
| 63 | |