summaryrefslogtreecommitdiff
path: root/mysys/my_addr_resolve.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '10.4' into 10.5Oleksandr Byelkin2021-01-061-1/+0
|\
| * MDEV-21646: postfix - my_addr_resolve: static Dl_info infoDaniel Black2020-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Encountered the linker failure on Debug build in 10.4: [53/585] Linking CXX executable unittest/sql/mf_iocache-t FAILED: unittest/sql/mf_iocache-t : && /usr/bin/c++ -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -fPIC -g -DENABLED_DEBUG_SYNC -ggdb3 -DSAFE_MUTEX -DSAFEMALLOC -DTRASH_FREED_MEMORY -Wall -Wextra -Wno-format-truncation -Wno-init-self -Wno-nonnull-compare -Wno-unused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -Werror -Wl,-z,relro,-z,now unittest/sql/CMakeFiles/mf_iocache-t.dir/mf_iocache-t.cc.o unittest/sql/CMakeFiles/mf_iocache-t.dir/__/__/sql/mf_iocache_encr.cc.o -o unittest/sql/mf_iocache-t -lpthread mysys/libmysys.a unittest/mytap/libmytap.a mysys_ssl/libmysys_ssl.a mysys/libmysys.a dbug/libdbug.a mysys/libmysys.a dbug/libdbug.a -lz -lm strings/libstrings.a -lpthread -lssl -lcrypto -ldl && : /usr/bin/ld: mysys/libmysys.a(my_addr_resolve.c.o):/home/dan/repos/mariadb-server-10.4/mysys/my_addr_resolve.c:173: multiple definition of `info'; unittest/sql/CMakeFiles/mf_iocache-t.dir/mf_iocache-t.cc.o:/home/dan/repos/mariadb-server-10.4/unittest/sql/mf_iocache-t.cc:99: first defined here We make Dl_info static as in MDEV-21646 moving it out of the function was the main goal and having it scope limited by static doesn't affect the function.
* | Merge branch '10.4' into 10.5Oleksandr Byelkin2020-11-011-8/+18
|\ \ | |/
| * Merge branch '10.1' into 10.2Oleksandr Byelkin2020-10-281-9/+18
| |\
| | * MDEV-14945 possible buffer overflow in stack resolverVicențiu Ciorbaru2020-10-261-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to https://stackoverflow.com/questions/22827510/how-to-avoid-bad-fd-set-buffer-overflow-crash it seems that using select instead of poll can cause additional memory allocations. As we are in a crashed state, we must prevent allocating any memory (if possible). Thus, switch select call to poll. Also move some bigger datastructures to global space. The code is not run in a multithreaded context so best we don't use up stack space if it's not needed.
* | | restore stack traces that were broken by ebfe8c4e0eSergei Golubchik2020-03-161-4/+0
| | |
* | | Merge branch '10.4' into 10.5Oleksandr Byelkin2020-03-111-0/+12
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-03-061-0/+12
| |\ \ | | |/
| | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-03-061-0/+12
| | |\
| | | * MDEV-21646: Failure to compile my_addr_resolve.c with binutils-2.34bb-5.5-MDEV-21646Oleksandr Byelkin2020-02-121-0/+12
| | | | | | | | | | | | | | | | Emulate older API
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-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-23/+45
|/ / / | | | | | | | | | | | | | | | | | | | | | 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().
* | | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2018-04-101-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-04-071-1/+1
| |\ \ | | |/
| | * compiler warningSergei Golubchik2018-04-031-1/+1
| | | | | | | | | | | | warning: format '%p' expects argument of type 'void *', but argument 4 has type 'long int'
* | | MDEV-15345 Compilation fails to build my_addr_resolve.cSergei Golubchik2018-02-221-0/+7
| | | | | | | | | | | | | | | fix the compilation error. no support for plugins yet.
* | | Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-73/+92
|\ \ \ | |/ /
| * | my_addr_resolve fixesSergei Golubchik2018-02-021-24/+23
| | | | | | | | | | | | | | | | | | * 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
| * | Merge branch 'github/10.0' into 10.1Sergei Golubchik2018-02-021-44/+65
| |\ \ | | |/
| | * MDEV-14229: Stack trace is not resolved for shared objectsVicențiu Ciorbaru2018-01-191-31/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | fix stack traces when linking with libbfdSergei Golubchik2016-12-121-12/+18
|/ / | | | | | | also, return different values for different errors in my_addr_resolve()
* | [MDEV-9468]: Client hangs in my_addr_resolveVicențiu Ciorbaru2016-01-261-1/+5
| | | | | | | | Account for timeout of select returning a 0 error code.
* | Remove warning in my_addr_resolveVicențiu Ciorbaru2016-01-171-2/+3
| | | | | | | | ISO C90 does not allow mixed declarations and code.
* | [MDEV-9427] Server does not build on OpenSUSE 42.1Vicențiu Ciorbaru2016-01-171-7/+9
| | | | | | | | Changed code to comply to C90 standard.
* | Fixed a crash during stacktrace printing if addr2line failed to start.Vicențiu Ciorbaru2016-01-171-14/+52
| | | | | | | | | | | | 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.
* | fix build on sol10-64Sergei Golubchik2015-10-151-1/+1
| |
* | MDEV-6479 stack traces in 10.1Sergei Golubchik2015-02-281-3/+17
|/ | | | | | 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.
* my_addr_resolve: don't resolve unknown addresses to ??:0(??), but return an ↵Sergei Golubchik2013-12-121-0/+4
| | | | | | error instead (better to have an address in the output than ??:0)
* 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
* a couple of minor post-5.5-merge cleanupsSergei Golubchik2012-03-261-1/+1
| | | | | | | | | | | | | | | 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
* Merge mariadb 5.3->mariadb 5.5unknown2012-03-241-1/+1
|
* alternative method of resolving addresses for safemalloc and crash handler.Sergei Golubchik2012-03-131-0/+66
| | | | don't link with libbfd, exec addr2line, if it's available at run time
* new configure option: NOT_FOR_DISTRIBUTIONSergei Golubchik2011-12-141-0/+1
| | | | | | | | | | | | | | | 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.
* another backtrace resolver that prints source file name and line numberSergei Golubchik2011-12-111-0/+131