summaryrefslogtreecommitdiff
path: root/dbug/dbug.c
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-061-4/+4
| | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* Flush gcov files for DBUG_ASSERT and DBUG_SUICIDEMonty2021-05-241-0/+12
|
* Merge 10.2 into 10.3Marko Mäkelä2020-07-021-2/+2
|\
| * Merge 10.1 into 10.2bb-10.2-mergeMarko Mäkelä2020-07-011-2/+2
| |\
| | * MDEV-22950 followupVladislav Vaintroub2020-06-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Deadlock in DbugParse, on Linux. In 10.1, DBUG recursive mutex was improperly implemented. CODE_STATE::locked counter was never updated. Copy the code around LockMutex/UnlockMutex from 10.2
| | * MDEV-22950 : fix race condition in dbugVladislav Vaintroub2020-06-201-2/+2
| | | | | | | | | | | | FreeState() zeros init_settings.out_file, which another thread can be using
* | | Merge 10.2 into 10.3Marko Mäkelä2019-12-121-2/+5
|\ \ \ | |/ /
| * | MDEV-21223 innodb_fts.sync_ddl fails in buildbot, server crashed in que_thr_stepEugene Kosov2019-12-101-2/+5
| | | | | | | | | | | | | | | | | | | | | FreeState(): replace pointer to freed memory with NULL. This actually fixes a crash which is use-after-free as reported by ASAN DbugParse(): unconditionally lock mutex because we're touching shared init_settings.keywords
* | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-12-041-79/+67
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-12-031-79/+67
| |\ \ | | |/
| | * try to fix data races in DBUGEugene Kosov2019-11-281-2/+40
| | | | | | | | | | | | | | | init_settings.keywords and it's pointee are shared data. Protect them with mutex too.
| | * cleanup DBUGEugene Kosov2019-11-211-39/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DbugParse(): removed mutex lock/unlock which should protect file writes only. And no file writes happen in this function. DbugFlush(): move mutex_unlock out of this method because fflush() doesn't need any locking. Slow stuff like mutex lock/unlock and accessing errno (TLS) is moved to a more narrow scope.
* | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-10-311-3/+0
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-10-301-3/+0
| |\ \ | | |/
| | * remove unused struct membersEugene Kosov2019-10-291-3/+0
| | |
| * | Make debug multi thread safeMonty2017-10-261-25/+86
| | | | | | | | | | | | | | | | | | | | | Fixes crashes in InList when calling _db_set_init (part of SET debug_dbug in the test suite) from another thread. Patch backported from 10.3
* | | MDEV-20525: Fix the -std=c90 buildsMarko Mäkelä2019-09-131-1/+1
| | |
* | | MDEV-20525 rocksdb debug compilation fails on Windows due to unresolved ↵Marko Mäkelä2019-09-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my_assert variable MYSQL_PLUGIN_IMPORT did not work correctly for the RocksDB helper library rocksdb_aux_lib, because that library was not compiled with -DMYSQL_DYNAMIC_PLUGIN. Fix DBUG such that it does not depend on exported data, only on functions (which do not need MYSQL_PLUGIN_IMPORT decoration) Use a "getter" function _db_my_assert() instead of DLL-exported variable. Also, reduce object code duplication by moving more of the DBUG_ASSERT logic inside the _db_my_assert() function, and add unlikely() and ATTRIBUTE_COLD hints to ensure that the 'assertion failed' code will be separated from the main control flow logic. Thus, the compiler can move the unlikely() code to the end of the compiled function, reachable via a forward conditional branch, which the processor's branch predictor could assume 'not taken'.
* | | Misc. typosluz.paz2018-04-051-2/+2
| | | | | | | | | | | | Found via `codespell -i 3 -w --skip="./debian/po" -I ../mariadb-server-word-whitelist.txt ./cmake/ ./debian/ ./Docs/ ./include/ ./man/ ./plugin/ ./strings/`
* | | Re-enable 'S' for --debug (sf_sanity checking for each call)Monty2017-12-221-3/+13
| | | | | | | | | | | | - Fixed also a wrong comment and a wrong argument to printf
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-2/+2
|\ \ \ | |/ /
| * | MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.Vladislav Vaintroub2017-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
* | | Make debug multi thread safeMonty2017-09-081-25/+87
| | | | | | | | | | | | | | | Fixes crashes in InList when calling _db_set_init (part of SET debug_dbug in the test suite) from another thread.
* | | Added DBUG_ASSERT_AS_PRINTF compile flagMonty2017-08-241-1/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If compiling a non DBUG binary with -DDBUG_ASSERT_AS_PRINTF asserts will be changed to printf + stack trace (of stack trace are enabled). - Changed #ifndef DBUG_OFF to #ifdef DBUG_ASSERT_EXISTS for those DBUG_OFF that was just used to enable assert - Assert checking that could greatly impact performance where changed to DBUG_ASSERT_SLOW which is not affected by DBUG_ASSERT_AS_PRINTF - Added one extra option to my_print_stacktrace() to get more silent in case of stack trace printing as part of assert.
* | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-1/+1
|\ \ | |/
| * MDEV-11752 Unsafe strmov - function definition in include/m_string.hSergei Golubchik2017-03-101-1/+1
| | | | | | | | | | assert that strmov() cannot be used on overlapping strings. (because strpcpy cannot)
* | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
* | MDEV-11713 Optimize DBUG_PRINT and introduce DBUG_LOGMarko Mäkelä2017-01-051-18/+17
|/ | | | | | | | | | | | | MariaDB Server is unnecessarily evaluating the arguments of DBUG_PRINT() macros when the label is not defined. The macro DBUG_LOG() for C++ operator<< output which was added for InnoDB diagnostics in MySQL 5.7 is missing from MariaDB. Unlike the MySQL 5.7 implementation, MariaDB will avoid allocating and initializing the output string when the label is not defined. Introduce DBUG_OUT("crypt") and DBUG_OUT("checksum") for some InnoDB diagnostics, replacing some use of ib::info().
* dbug: correct trace for DBUG_RETURN(func()); -- gcc onlySergei Golubchik2015-11-161-3/+7
| | | | | | | | | | | when func1 calls func2 from DBUG_RETURN, dbug shows the trace as | > func1 | < func1 | > func2 | < func2 because DBUG_LEAVE happens before func2(). Change that to invoke DBUG_LEAVE when the local variable goes out of scope. This uses gcc specific __attribute__((cleanup)).
* 5.5 mergeSergei Golubchik2014-03-261-0/+1
|\
| * MDEV-5913 Windows: 10.0 crashes on shutdownSergei Golubchik2014-03-241-0/+1
| | | | | | | | | | add pthread_mutex_destroy(&THR_LOCK_dbug); that was apparently forgotten since the very first MySQL version
* | 10.0-base merge.Sergei Golubchik2013-09-211-0/+1
|\ \ | |/ | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * MDEV-4815 - allow multiple mysql_server_init() / mysql_server_end() in the ↵Vladislav Vaintroub2013-07-291-0/+1
| | | | | | | | | | | | | | | | same process, for embedded library. - Reset static variables that are used to signal "init done" for DBUG, in dbug_end() - Set string server variables to NULL after memory for the value is freed - avoids double free() - fix DBUG_ASSERTs that happened during reinitialization.
* | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-2/+2
|/
* Fixed compiler warnings (A few of these was bugs)Michael Widenius2012-08-131-3/+0
| | | | | | | | | | | | | | | | | | | client/mysqldump.c: Slave needs to be initialized with 0 dbug/dbug.c: Removed not existing function plugin/semisync/semisync_master.cc: Fixed compiler warning sql/opt_range.cc: thd needs to be set early as it's used in some error conditions. sql/sql_table.cc: Changed to use uchar* to make array indexing portable storage/innobase/handler/ha_innodb.cc: Removed not used variable storage/maria/ma_delete.c: Fixed compiler warning storage/maria/ma_write.c: Fixed compiler warning
* fix a memory leak in dbugSergei Golubchik2012-03-241-1/+11
|
* mdev-200 set session dbug resets the output to stderr.Sergei Golubchik2012-03-231-87/+90
| | | | | | | it makes "./mtr --debug" unusable revert the mysql fix for bug#46165. implement shared FILE's with reference counting
* Merge latest MariaDB 5.5 into MWL#192: Non-blocking client library.unknown2012-02-221-0/+4
|\
| * Fix memory leak when one +O debug on top of another.unknown2012-02-081-0/+4
| |
* | Merge MWL#192: Non-blocking client library, into MariaDB 5.5.unknown2012-02-211-0/+21
|\ \ | |/ |/|
| * MWL#192: Non-blocking client API for libmysqlclient.unknown2011-09-201-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All client functions that can block on I/O have alternate _start() and _cont() versions that do not block but return control back to the application, which can then issue I/O wait in its own fashion and later call back into the library to continue the operation. Works behind the scenes by spawning a co-routine/fiber to run the blocking operation and suspend it while waiting for I/O. This co-routine/fiber use is invisible to applications. For i368/x86_64 on GCC, uses very fast assembler co-routine support. On Windows uses native Win32 Fibers. Falls back to POSIX ucontext on other platforms. Assembler routines for more platforms are relatively easy to add by extending mysys/my_context.c, eg. similar to the Lua lcoco library. For testing, mysqltest and mysql_client_test are extended with the option --non-blocking-api. This causes the programs to use the non-blocking API for database access. mysql-test-run.pl has a similar option --non-blocking-api that uses this, as well as additional testcases. An example program tests/async_queries.c is included that uses the new non-blocking API with libevent to show how, in a single-threaded program, to issue many queries in parallel against a database. client/async_example.c: Fix const warning ****** Fix bug with wrong timeout value for poll(). include/Makefile.am: Fix missing include for `make dist` include/mysql.h: Add prototypes for all non-blocking API calls. include/mysql.h.pp: Add prototypes for all non-blocking API calls. mysys/my_context.c: Fix type warning for makecontext() function pointer argument. sql-common/mysql_async.c: Fix crashes in the non-blocking API for functions that can take MYSQL argument that is NULL. tests/Makefile.am: Add header file to `make dist` tests/mysql_client_test.c: Replace blocking calls with wrappers around the non-blocking calls, used in mysql_client_test to test the new non-blocking API. tests/nonblock-wrappers.h: Replace blocking calls with wrappers around the non-blocking calls, used in mysql_client_test to test the new non-blocking API.
* | fixes for opensolaris compilation failuresSergei Golubchik2012-01-051-0/+10
| |
* | move safemalloc out of dbug.Sergei Golubchik2011-12-121-359/+3
| | | | | | | | | | | | remeber a real backtrace for every allocation. make safemalloc to tract C++ new/delete too. collateral fixes to make the test suite pass.
* | Make it possible to compile without SAFEMALLOC in debug buildsVladislav Vaintroub2011-12-021-1/+12
| | | | | | | | | | | | Default to no SAFEMALLOC on Windows, because C runtime malloc has this functionslity already
* | mergeSergei Golubchik2011-11-031-4/+8
|\ \
| * | build on windowsSergei Golubchik2011-11-021-4/+8
| | |
* | | mysql-5.5.18 mergeSergei Golubchik2011-11-031-2/+0
|\ \ \ | |/ / |/| |
| * | Bug#12727287: Maintainer mode compilation fails with gcc 4.6Davi Arnaut2011-07-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6 has new -Wunused-but-set-variable flag, which is enabled by -Wall, that causes GCC to emit a warning whenever a local variable is assigned to, but otherwise unused (aside from its declaration). Since the maintainer mode uses -Wall and -Werror, source code which triggers these warnings will be rejected. That is, these warnings become hard errors. The solution is to fix the code which triggers these specific warnings. In most of the cases, this is a welcome cleanup as code which triggers this warning is probably dead anyway. dbug/dbug.c: Unused but set. libmysqld/lib_sql.cc: Length is not necessary as the converted error message is always null-terminated. sql/item_func.cc: Make get_var_with_binlog private to this compilation unit. If a error was raised, do not attempt to evaluate the user variable as the statement execution will be interrupted anyway. sql/mysqld.cc: Use a void expression to silence the warning. Avoids the use of macros that would make the code more unreadable than it already is. sql/protocol.cc: Length is not necessary as the converted error message is always null-terminated. Remove unnecessary casts and assignment. sql/sql_class.h: Function is only used in a single compilation unit. sql/sql_load.cc: Only use the variable outside of EMBEDDED_LIBRARY. storage/innobase/btr/btr0cur.c: Do not retrieve field, only the record length is being used. storage/perfschema/pfs.cc: Use a void expression to silence the warning. tests/mysql_client_test.c: Unused but set. unittest/mysys/lf-t.c: Unused but set.
* | | merge with 5.3Sergei Golubchik2011-10-191-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * \ \ Merge with 5.2Michael Widenius2011-03-091-0/+19
| |\ \ \ | | | |/ | | |/|