summaryrefslogtreecommitdiff
path: root/mysql-test/lib
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-30242 MTR fails to report stack traces of all threads by defaultMarko Mäkelä2022-12-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | An unfortunate change to the default behavior of the handling of core dumps was implemented in commit e9be5428a27eaaccf142f2bd53f4d30e8e368484 by making MTR_PRINT_CORE=small the default value, that is, to only display the stack trace of one thread in crash reports. Many if not most failures that occur in regression tests are sporadic and involve race conditions or deadlocks. To be able to analyze such failures, having the stack traces of all active threads is a must, because CI environments typically do not save any core dumps. While the environment variable MTR_PRINT_CORE could be set in CI environments to compensate for the unfortunate change, it is better to revert to the old default (dumping all threads) so that no explicit action will be required from maintainers of independent CI systems. In that case, if something fails once in a blue moon, we can have some hope of diagnosing it based on the output. We fix this regression by defaulting the unset environment variable MTR_PRINT_CORE to "medium".
* MDEV-29348 rpl.rpl_rewrt_db test fails with [gdb,manual-gdb] with wrong parsingAnel Husakovic2022-11-281-1/+1
| | | | | Reviewer: <serg@mariadb.com> Closes PR #2244
* my_safe_process: try to kill the process softly firstSergei Golubchik2022-08-101-2/+9
| | | | | | | first SIGTERM and if the process didn't die in 10 seconds, SIGKILL it. This allows various tools like `rr`, `gcov`, `gprof`, etc to flush their data to disk properly
* MDEV-29025 Refactoring: moved out core_wanted() out of mysql-test-run.plAleksey Midenkov2022-07-181-1/+35
|
* MDEV-28931 MTR prints detailed stack trace unconditionallyAleksey Midenkov2022-07-181-33/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 66832e3a introduced change that prints core dumps in very detailed format. That's completely out of user-friendliness but serves as a measure for debugging hard-reproducible bugs. The proper way to implement this: 1. it must be controlled by command-line and environment variable; 2. detailed traces must be default for buildbots only, for user invocations normal stack traces should be printed. Options for control are: MTR_PRINT_CORE and --print-core that accept the following values: no Don't print core short Print stack trace of failed thread medium Print stack traces of all threads detailed Print all stack traces with debug context custom:<code> Use debugger commands <code> to print stack trace Default setting is: short (see env_or_default() call in pre_setup()) For environment variable wrong values are silently ignored (falls back to default setting, see env_or_default()). Command-line option --print-core (or -C) overrides environment variable. Its default value is 'short' if not specified explicitly (same env_or_default() call in pre_setup()). Explicit values are checked for validity. --print-method option can specify by which debugger we print cores. For Windows there is only one choice: cdb. For Unix the values are: gdb, dbx, lldb, auto. Default value is: auto In 'auto' we try to use all possible debuggers until success.
* MDEV-28931 Debugger.pm readability fixAleksey Midenkov2022-07-181-38/+51
| | | | | | | | | | | | | | | | | setup_boot_args(), setup_client_args(), setup_args() traversing datastructures on each invocation. Even if performance is not important to perl script (though it definitely saves some CO2), this nonetheless provokes some code-reading questions. Reading and debugging such code is not convenient. The better way is to prepare all the data in advance in an easily readable form as well as do the validation step before any further processing. Use mtr_report() instead of die() like the other code does. TODO: do_args() does even more data processing magic. Prepare that data according the above strategy in advance in pre_setup() if possible.
* MDEV-28931 --verbose option is too verboseAleksey Midenkov2022-07-185-26/+35
| | | | | | | | GetOpt::Long bundling option for convenient one-char verbosity levels: -v General verbosity (file and execute operations) -vv High verbosity (algorithmic considerations) -vvv Debug verbosity (anything else)
* MDEV-28931 Cleanup: try GDB to print core firstAleksey Midenkov2022-07-181-4/+1
| | | | Do we still need this Sun Studio hack?
* Merge branch '10.2' into 10.3Sergei Golubchik2022-04-211-1/+4
|\
| * mtr: extend gdb backtace infoDaniel Black2022-04-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bt full - to include args and locals. set print sevenbit on - it is more useful to be able to see the exact bytes (in case something is dumped as a string and not hexadecimal digits) set print static-members off - there are many interesting (non-const) static members set frame-arguments all - even non-printables are useful to see. Let's make our bb logs give a little bit more detail on those hard to reproduce bugs. Tests on rhel7's gdb-7.6.1-120.el7
* | mtr: fix --source lines detectionSergei Golubchik2022-03-141-1/+1
| | | | | | | | mysqltest allows leading spaces before `--`, so mtr should too
* | Merge branch '10.2' into 10.3mariadb-10.3.33Oleksandr Byelkin2022-01-291-2/+2
|\ \ | |/
| * mtr failed to detect when a combination is forcedSergei Golubchik2022-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | mtr detects a forced combination if the command line for a test already includes all options from this combination. options are stored in a perl hash as (key,value) pairs. this breaks if the command line has two options with the same name, like --plugin-load-add=foo --plugin-load-add=bar, and the combination forces plugin foo. In particular, this resulted in warnings when running federated.federatedx_versioning test
* | Merge 10.2 into 10.3Marko Mäkelä2021-11-091-1/+2
|\ \ | |/
| * MDEV-26949 --debug-gdb installs redundant signal handlersMarko Mäkelä2021-11-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a server startup option --gdb a.k.a. --debug-gdb that requests signals to be set for more convenient debugging. Most notably, SIGINT (ctrl-c) will not be ignored, and you will be able to interrupt the execution of the server while GDB is attached to it. When we are debugging, the signal handlers that would normally display a terse stack trace are useless. When we are debugging with rr, the signal handlers may interfere with a SIGKILL that could be sent to the process by the environment, and ruin the rr replay trace, due to a Linux kernel bug https://lkml.org/lkml/2021/10/31/311 To be able to diagnose bugs in kill+restart tests, we may really need both a trace before the SIGKILL and a trace of the failure after a subsequent server startup. So, we had better avoid hitting the problem by simply not installing those signal handlers.
* | Merge 10.2 into 10.3Marko Mäkelä2021-10-212-5/+5
|\ \ | |/
| * MDEV-19129: Xcode compatibility update: mysql-test-run.pl: rename ↵Sergei Krivonos2021-10-212-5/+5
| | | | | | | | $opt_vs_config to $multiconfig to use with other cmake multiconfig generators
* | MDEV-11499 mysqltest, Windows : improve diagnostics if server fails to shutdownVladislav Vaintroub2021-09-242-108/+4
| | | | | | | | | | | | | | | | | | | | | | Create minidump when server fails to shutdown. If process is being debugged, cause a debug break. Moves some code which is part of safe_kill into mysys, as both safe_kill, and mysqltest produce minidumps on different timeouts. Small cleanup in wait_until_dead() - replace inefficient loop with a single wait.
* | Merge 10.2 into 10.3Marko Mäkelä2021-08-312-17/+11
|\ \ | |/
| * mtr: fix the check where a combination is pre-selectedSergei Golubchik2021-08-292-17/+11
| | | | | | | | | | | | | | | | | | if all options from a combination from the combinations file are already present in the server's list of options, then don't try to run tests in other combinations from this file. old behavior was: if at least one option from a combination is already present in the list...
* | Merge branch '10.2' into 10.3Sergei Golubchik2021-07-212-12/+14
|\ \ | |/
| * MDEV-25802 mtr: race condition if the test quickly restarts twiceSergei Golubchik2021-07-062-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | part II need to tell SafeProcess not to collect the exited mysqld in sleep_until_file_created(), so that it would be found in the later wait_any_timeout() in run_testcase() Removed a strange condition in SafeProcess::wait_one() that treated return value of -1 from waitpid() as "process exists" instead of as "no such child process" (see `perldoc -f waitpid`)
| * MDEV-25802 mtr: race condition if the test quickly restarts twiceSergei Golubchik2021-07-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | expect file is always removed before starting a server. So if it exists here, it means the server started successfully, mysqltest continued executing the test, created a new expect file, and shut down the server. All while we were waiting for the server to start. In other words, if the expect file exists, the server did actually start. Even if it isn't running now. This fixes occasional failures of innodb.log_corruption (in 10.6)
* | MDEV-25894: support AIX as a platform in mtrDaniel Black2021-07-021-1/+10
| | | | | | | | | | Parital backport of 48938c57c7f75b2a7627212b01cd65cfd6830261 so platform dependent AIX tests can be done.
* | Merge 10.2 into 10.3Marko Mäkelä2021-06-011-1/+1
|\ \ | |/
| * mtr: fix the debug printoutSergei Golubchik2021-05-271-1/+1
| | | | | | | | to print all arguments of _verbose(), not just the number of them
* | Merge 10.2 into 10.3, except MDEV-25682Marko Mäkelä2021-05-181-1/+1
|\ \ | |/
| * mtr: --gdb mode, also quote ";", not only " "Sergei Golubchik2021-05-111-1/+1
| |
* | Merge 10.2 into 10.3Marko Mäkelä2021-05-101-2/+2
|\ \ | |/
| * mtr --gdb='commands' and restartsSergei Golubchik2021-05-081-1/+1
| | | | | | | | | | if mysqld is restarted during a test, the debugger script should be reused or overwritten, but not appended to the existing file
| * fix mtr --client-gdb to workSergei Golubchik2021-05-081-1/+1
| | | | | | | | mysqltest has no --gdb option
* | Merge 10.2 into 10.3Marko Mäkelä2021-04-131-11/+19
|\ \ | |/
| * MDEV-24135: Print warnings in XML, save test retries in XML, save the ↵Dmitriy Karpovskiy2021-04-121-11/+19
| | | | | | | | combinations in XML, replace the special symbols in the XML comment
* | Merge 10.2 into 10.3Marko Mäkelä2021-03-271-1/+1
|\ \ | |/
| * Added missed ' -- ' between the end of the lldb command options and the ↵Dmitry Shulga2021-03-221-1/+1
| | | | | | | | beginning of the arguments.
* | Merge 10.2 into 10.3Marko Mäkelä2021-03-031-1/+2
|\ \ | |/
| * mtr --gdb: fix for --rr and for a warningSergei Golubchik2021-03-011-1/+2
| | | | | | | | | | | | | | use _RR_TRACE_DIR=dir instead of -o dir, as the former can store multiple traces in dir (if, e.g., the test restarts mysqld) suppress uninitialized warning when $exe is undefined (--manual-XXX)
* | Merge branch '10.2' into 10.3Sergei Golubchik2021-02-221-0/+265
|\ \ | |/
| * mtr fixes for old (5.10.1) perlSergei Golubchik2021-02-221-4/+5
| |
| * support for mtr --valgdbSergei Golubchik2021-02-221-3/+20
| | | | | | | | | | | | add a new "debugger" to mtr, that runs the executable under valgrind in gdb. valgrind pid is auto-detected, but the delay (sleep) and vgdb path are hard-coded for now
| * unify mtr handling of debuggersSergei Golubchik2021-02-221-0/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "debugger" is anything that wraps execution of a target binary (mysqld or mysqltest). Currently the list includes: gdb, ddd, dbx, lldb, valgrind, strace, ktrace, rr, devenv, windbg, vsjitdebugger. for every debugger xxx, mtr will recognize four options: --xxx, --boot-xxx, --manual-xxx, --client-xxx. They all support an optional "=string" argument. String being a semicolon-separated list of commands (e.g. for gdb) or one (not semicolon-separated) command line of options (e.g. for valgrind). Or both (e.g. --gdb='-quiet -nh;info files' In embedded both --xxx and --client-xxx work. Functionality changed/removed: * --rr-args is gone * --rr-dir is gone * --manual-debug is gone * --debugger={devenv|vc|windbg|vc_express|vsjitdebugger} is gone * --strace-option is gone * --stracer={strace|ktrace} is gone * --valgrind only enables it for the server, not for everything * --valgrind-all is gone * --valgrind-mysqltest is gone * --valgrind-mysqld is gone * --valgrind-options is gone * --valgrind-option is gone * --valgrind-path is gone * --callgrind is gone * one cannot combine --valgrind --gdb anymore * valgrind report doesn't add a fake test line to the output * vc and vcexpress on windows are no longer supported
* | Merge 10.2 into 10.3Marko Mäkelä2020-12-011-3/+7
|\ \ | |/
| * MDEV-24100 Failed to read test report file: Invalid byte 2 of 3-byte UTF-8 ↵Rasmus Johansson2020-11-181-3/+7
| | | | | | | | | | | | | | | | sequence. Explicitly setting encoding to UTF-8 when writing to file and replacing wide characters from MTR_RES_FAILED when writing to XML file. The wide characters are not allowed in XML.
* | cleanup: use predefined CMAKE_DL_LIBSSergei Golubchik2020-10-231-1/+1
| | | | | | | | instead of, say, MY_SEARCH_LIBS(dlopen dl LIBDL)
* | Merge 10.2 into 10.3Marko Mäkelä2020-07-029-9/+9
|\ \ | |/
| * Merge 10.1 into 10.2bb-10.2-mergeMarko Mäkelä2020-07-019-9/+9
| |\
| | * mtr: use env for perlDaniel Black2020-06-239-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | On FreeBSD, perl isn't in /usr/bin, its in /usr/local/bin or elsewhere in the path. Like storage/{maria/unittest/,}ma_test_* , we use /usr/bin/env to find perl and run it.
| | * MDEV-22631 fixRasmus Johansson2020-05-201-1/+11
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2020-05-291-15/+45
|\ \ \ | |/ /
| * | mtr: update titlebar when the test ends, not when it startsSergei Golubchik2020-05-271-15/+45
| | | | | | | | | | | | | | | | | | | | | otherwise it reaches "0 tests left" state and then waits for a few minutes for all workers to complete their tests. show failures. account for retries.