summaryrefslogtreecommitdiff
path: root/mysys/stacktrace.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2019-05-231-1/+1
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |\
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | | Make it trivial to get stack traces from external programs.Monty2019-05-231-4/+41
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get a stacktrace in a program like aria_chk, one only have to do: #include <my_stacktrace.h> call my_init_stacktrace(1) in main().
* | | | Make possible to use clang on Windows (clang-cl)Vladislav Vaintroub2018-02-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | -DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
* | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2017-08-261-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-08-171-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch '10.0' into 10.1Sergei Golubchik2017-08-081-1/+1
| | |\ \
| | | * \ Merge remote-tracking branch 'origin/5.5' into 10.0Vicențiu Ciorbaru2017-07-251-1/+1
| | | |\ \ | | | | |/
| | | | * MDEV-12144 Signal 6 crash corrupts ibd filesSergei Golubchik2017-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Avoid using STDERR_FILENO. The server uses freopen(stderr), so stderr can be on any file descriptor.
* | | | | Added DBUG_ASSERT_AS_PRINTF compile flagMonty2017-08-241-6/+10
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Fix several compile warnings on WindowsVladislav Vaintroub2017-03-171-0/+11
| | | |
* | | | MDEV-10943 . Workaround linker error on Linux. Linux does not actually use ↵Vladislav Vaintroub2016-10-151-2/+2
|/ / / | | | | | | | | | __bss_start, put __bss_start into #ifndef __linux__ section
* | | Merge branch '10.0' into 10.1Sergei Golubchik2016-07-131-4/+26
|\ \ \ | |/ /
| * | [MDEV-9127] Crash reporter often fails to show the query that crashedVicențiu Ciorbaru2016-07-121-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | Addreses are not necessarily between heap_start && heap_end. Malloc calls using mmap can place pointers outside these bounds. In this case, we'll warn the user that the query pointer is potentially invalid. However, we'll attempt to print the data anyway after we're done printing everything else.
* | | MDEV-6650 - LINT_INIT emits code in non-debug buildsSergey Vojtovich2015-03-161-2/+1
|/ / | | | | | | | | Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT. Removed LINT_INIT macro.
* | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-2/+2
|/
* do not print return address when callstack is output on Windows, it does not ↵Vladislav Vaintroub2012-10-181-1/+0
| | | | provide any useful info
* mysql-5.5.22 mergeSergei Golubchik2012-03-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | mysql-test/suite/innodb/t/group_commit_crash.test: remove autoincrement to avoid rbr being used for insert ... select mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test: remove autoincrement to avoid rbr being used for insert ... select mysys/my_addr_resolve.c: a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack mysys/stacktrace.c: my_vsnprintf() is ok here, in 5.5
* \ Merge mariadb 5.3->mariadb 5.5unknown2012-03-241-183/+5
|\ \
| * | restore my_safe_printf_stderr for "crash-safe sigsegv handler"Sergei Golubchik2012-03-141-186/+8
| | | | | | | | | | | | | | | | | | use vsnprintf() use write() on windows, not WriteFile or fwrite() localtime_r is still a problem
* | | Merge 5.3->5.5Igor Babaev2012-03-171-8/+4
|\ \ \ | |/ /
| * | LP953714: Fix formatting of the crash messages in signal/exception handlerVladislav Vaintroub2012-03-121-11/+7
| | |
* | | 5.3 mergeSergei Golubchik2012-02-211-8/+9
|\ \ \ | |/ /
| * | Fixed compiler warningsMichael Widenius2012-02-201-1/+1
| | |
| * | Merge with MYSQL 5.1.61Michael Widenius2012-02-201-77/+294
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed README with link to source Merged InnoDB change to XtraDB README: Added information of where to find MariaDB code storage/archive/ha_archive.cc: Removed memset() of rows, a MariaDB checksum's doesn't touch not used data.
| | * | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2011-11-301-65/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/Makefile.am: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/signal_handler.cc: Remove unsafe function calls.
* | | | - Fix rpl_checksum test. Use basename of file in error messages, not the oVladislav Vaintroub2012-01-201-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nes prefixed with .\ or ./ - Add my_basename() to mysys. - Do not compile files that are not needed on Windows (my_addr_resolve, an d safemalloc related stuff it it is not used) Avoids linker warnings about compilation of essentially empty files.
* | | | mysql-5.5 mergeSergei Golubchik2012-01-161-61/+274
|\ \ \ \ | | |_|/ | |/| |
| * | | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2011-12-021-61/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/set_var.h: Add missing #include dependency. sql/sys_vars.cc: Cleanup .h and .cc files. sql/sys_vars.h: Cleanup .h and .cc files.
* | | | 5.3 mergeSergei Golubchik2012-01-131-1/+2
|\ \ \ \ | | |/ / | |/| |
| * | | Initail merge with MySQL 5.1 (XtraDB still needs to be merged)Michael Widenius2011-11-211-3/+5
| |\ \ \ | | | |/ | | |/| | | | | Fixed up copyright messages.
* | | | another backtrace resolver that prints source file name and line numberSergei Golubchik2011-12-111-5/+32
| | | |
* | | | mysql-5.5.18 mergeSergei Golubchik2011-11-031-2/+2
|\ \ \ \ | | |_|/ | |/| |
| * | | Updated/added copyright headersKent Boortz2011-06-301-2/+2
| |\ \ \ | | | |/ | | |/|
| | * | Updated/added copyright headersKent Boortz2011-06-301-3/+5
| | |/
* | | add safemalloc backSergei Golubchik2011-07-101-9/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... but differently client/mysqltest.cc: my_safe_print_str() don't append \n anymore dbug/dbug.c: restore safemalloc as a part of dbug suite dbug/user.r: restore 'S' flag documentation include/my_dbug.h: restore safemalloc as a part of dbug suite include/my_sys.h: move valgrind defines to a dedicated header mysys/my_malloc.c: use new safemalloc mysys/stacktrace.c: don't append \n. let the calller do it, if needed sql/mysqld.cc: my_safe_print_str() don't append \n anymore
* | Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid ↵Davi Arnaut2011-03-021-2/+2
| | | | | | | | | | | | | | pointer Post-merge fix: equal sign is now meaningless, the string being printed was already preceded by a colon.
* | Merge of mysql-5.1-bugteam into mysql-5.5-bugteam.Davi Arnaut2010-11-301-1/+4
|\ \ | |/
| * Workaround a GCC warning about a pointer being cast to a largerDavi Arnaut2010-11-301-1/+4
| | | | | | | | | | | | | | | | | | integral type. Use intptr which is designed to hold pointer values and pass it to off_t. mysys/stacktrace.c: Add a compile time assert to ensure that off_t is large enough to hold the pointer value.
* | Merge of mysql-5.1-bugteam into mysql-5.5-bugteam.Davi Arnaut2010-11-301-7/+96
|\ \ | |/
| * Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid ↵Davi Arnaut2010-11-261-7/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pointer The problem is that the logic which checks if a pointer is valid relies on a poor heuristic based on the start and end addresses of the data segment and heap. Apart from miscalculating the heap bounds, this approach also suffers from the fact that memory can come from places other than the heap. See Bug#58528 for a more detailed explanation. On Linux, the solution is to access the process's memory through /proc/self/task/<tid>/mem, which allows for retrieving the contents of pages within the virtual address space of the calling process. If a address range is not mapped, a input/output error is returned. client/mysqltest.cc: Use new interface to my_safe_print_str. include/my_stacktrace.h: Drop name from my_safe_print_str. mysys/stacktrace.c: Access the process's memory through a file descriptor and dump the contents of the memory range. The file descriptor offset is equivalent to a offset into the address space. Do not print the name of the variable associated with the address. It can be better accomplished at a higher level. sql/mysqld.cc: Put the variable dumping information within its own newline block. Use symbolic names which better convey information to the user.
| * Bug #45288 pb2 returns a lot of compilation warningsJon Olav Hauglid2010-11-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | GCOV builds were broken after the patch for Bug#57933 which added add -Wdeclaration-after-statement to gcc builds. This patch fixes: stacktrace.c:328: warning: ISO C90 forbids mixed declarations and code No test case added.
* | Merge from mysql-5.1-bugteam to mysql-5.5-bugteamJon Olav Hauglid2010-11-081-1/+3
|\ \ | | | | | | | | | | | | No conflicts
| * | Bug #45288 pb2 returns a lot of compilation warningsJon Olav Hauglid2010-11-081-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | GCOV builds were broken after the patch for Bug#57933 which added add -Wdeclaration-after-statement to gcc builds. This patch fixes: stacktrace.c:328: warning: ISO C90 forbids mixed declarations and code No test case added.
* | Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains ↵unknown2010-08-031-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | load data infile With statement- or mixed-mode logging, "LOAD DATA INFILE" queries are written to the binlog using special types of log events. When mysqlbinlog reads such events, it re-creates the file in a temporary directory with a generated filename and outputs a "LOAD DATA INFILE" query where the filename is replaced by the generated file. The temporary file is not deleted by mysqlbinlog after termination. To fix the problem, in mixed mode we go to row-based. In SBR, we document it to remind user the tmpfile is left in a temporary directory. mysql-test/suite/binlog/r/binlog_mixed_load_data.result: Test result for BUG#34283. mysql-test/suite/binlog/t/binlog_killed_simulate.test: Updated for BUg#34283 mysql-test/suite/binlog/t/binlog_mixed_load_data.test: Added the test file to verify that 'load data infile...' statement will go to row-based in mixed mode. mysql-test/suite/binlog/t/binlog_stm_blackhole.test: Updated for BUg#34283 mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_loaddata.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_loaddata_fatal.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_loaddata_map.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_stm_log.test: Updated for B mysys/stacktrace.c: Auto merge sql/sql_lex.cc: Auto merg sql/sql_load.cc: Added code to go to row-based in mixed mode for 'load data infile ...' statement
| * Bug#45288: pb2 returns a lot of compilation warnings on linuxDavi Arnaut2010-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | Fix compiler warnings. mysys/stacktrace.c: Tag unused parameters. sql/sql_lex.cc: Variable becomes unused in non-debug builds. Also, no need to assert the obvious.