Commit graph

32 commits

Author SHA1 Message Date
Sergei Golubchik
0afccbf7b8 restore stack traces that were broken by ebfe8c4e0e 2020-03-16 01:13:01 +01:00
Oleksandr Byelkin
fad47df995 Merge branch '10.4' into 10.5 2020-03-11 17:52:49 +01:00
Oleksandr Byelkin
75d286c2cc Merge branch '10.1' into 10.2 2020-03-06 15:42:45 +01:00
Oleksandr Byelkin
345aaca14c Merge branch '5.5' into 10.1 2020-03-06 11:06:48 +01:00
Oleksandr Byelkin
be77fa914c MDEV-21646: Failure to compile my_addr_resolve.c with binutils-2.34
Emulate older API
2020-02-12 15:39:36 +01:00
Marko Mäkelä
826f9d4f7e Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
Monty
ebfe8c4e0e Make it trivial to get stack traces from external programs.
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().
2019-05-23 02:28:23 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Vicențiu Ciorbaru
45e6d0aebf Merge branch '10.1' into 10.2 2018-04-10 17:43:18 +03:00
Vicențiu Ciorbaru
4c89cff558 Merge branch '10.0' into 10.1 2018-04-07 17:11:22 +03:00
Sergei Golubchik
df6197c8b9 compiler warning
warning: format '%p' expects argument of type 'void *', but argument 4 has type 'long int'
2018-04-03 16:19:10 +02:00
Sergei Golubchik
e92cc09765 MDEV-15345 Compilation fails to build my_addr_resolve.c
fix the compilation error.
no support for plugins yet.
2018-02-22 16:46:11 +01:00
Sergei Golubchik
4771ae4b22 Merge branch 'github/10.1' into 10.2 2018-02-06 14:50:50 +01:00
Sergei Golubchik
29031fe391 my_addr_resolve fixes
* use a longer timeout, 10ms is not always enough
* stop waiting as long as the data is read, do not unconditionally
  wait for timeout every time
2018-02-02 11:42:07 +01:00
Sergei Golubchik
d4df7bc9b1 Merge branch 'github/10.0' into 10.1 2018-02-02 10:09:44 +01:00
Vicențiu Ciorbaru
26e5f9dda1 MDEV-14229: Stack trace is not resolved for shared objects
Resolving a stacktrace including functions in dynamic libraries requires
us to look inside the libraries for the symbols. Addr2line needs to be
started with the correct binary for each address on the stack. To do this,
figure out which library it is using dladdr, then if the addr2line
binary was started with a different binary, fork it again with the
correct one.

We only have one addr2line process running at any point during the
stacktrace resolving step. The maximum number of forks for addr2line should
generally be around 6.

One for server stacktrace code, one for plugin code, one when going back
into server code, one for pthread library, one for libc, one for the
_start function in the server. More can come up if plugin calls server
function which goes back to a plugin, etc.
2018-01-19 16:11:34 +02:00
Sergei Golubchik
e336fc07bd fix stack traces when linking with libbfd
also, return different values for different errors in my_addr_resolve()
2016-12-12 20:27:20 +01:00
Vicențiu Ciorbaru
7d39b28093 [MDEV-9468]: Client hangs in my_addr_resolve
Account for timeout of select returning a 0 error code.
2016-01-26 21:42:37 +02:00
Vicențiu Ciorbaru
275f7d7d82 Remove warning in my_addr_resolve
ISO C90 does not allow mixed declarations and code.
2016-01-17 22:33:36 +02:00
Vicențiu Ciorbaru
b2bd10d4d6 [MDEV-9427] Server does not build on OpenSUSE 42.1
Changed code to comply to C90 standard.
2016-01-17 22:26:22 +02:00
Vicențiu Ciorbaru
6d3ffd2e3a Fixed a crash during stacktrace printing if addr2line failed to start.
In order to get all the input from addr2line we must read in a loop,
until the response is complete. Also, in case that the response is
malformed, we must not end up reading invalid memory.
2016-01-17 14:20:09 +02:00
Sergei Golubchik
1993780284 fix build on sol10-64 2015-10-15 12:23:04 +02:00
Sergei Golubchik
c78f594bbc MDEV-6479 stack traces in 10.1
Take into account that PIE binaries are loaded at some offset, so
addresses cannot be directly resolved with addr2line. Find this
offset and subtract it before resolving an address.
2015-02-28 19:48:22 +01:00
Sergei Golubchik
ca083a764f my_addr_resolve: don't resolve unknown addresses to ??:0(??), but return an error instead
(better to have an address in the output than ??:0)
2013-12-12 18:14:14 +01:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
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
2012-03-28 01:04:46 +02:00
Sergei Golubchik
d92009231d a couple of minor post-5.5-merge cleanups
include/mysql_com.h:
  remove "shutdown levels" that aren't shutdown levels from mysql_enum_shutdown_level
mysys/my_addr_resolve.c:
  my_snprintf in 5.5 (but not in 5.3) supports %p
sql/item_func.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/item_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/opt_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/sql_select.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
2012-03-26 12:33:49 +02:00
unknown
335de5db18 Merge mariadb 5.3->mariadb 5.5 2012-03-24 18:21:22 +01:00
Sergei Golubchik
00f2e3139f alternative method of resolving addresses for safemalloc and crash handler.
don't link with libbfd, exec addr2line, if it's available at run time
2012-03-13 13:34:24 +01:00
Sergei Golubchik
db8f698c8a new configure option: NOT_FOR_DISTRIBUTION
fix safemalloc to compile w/o libbfd.

CMakeLists.txt:
  NOT_FOR_DISTRIBUTION option
cmake/readline.cmake:
  simplify libedit/readline detection.
  never use bundled libedit.
  use system readline v6 only if NOT_FOR_DISTRIBUTION=1
configure.cmake:
  use libbfd only if NOT_FOR_DISTRIBUTION=1
include/my_stacktrace.h:
  link with libbfd even w/o safemalloc.
2011-12-14 10:53:32 +01:00
Sergei Golubchik
37c81d81b3 another backtrace resolver that prints source file name and line number 2011-12-11 09:00:12 +01:00