summaryrefslogtreecommitdiff
path: root/mysys
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.2' into 10.3Oleksandr Byelkin2020-12-231-1/+1
|\
| * 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 10.2 into 10.3Marko Mäkelä2020-11-022-3/+4
|\ \ | |/
| * MDEV-22387: Do not violate __attribute__((nonnull))Marko Mäkelä2020-11-022-3/+4
| | | | | | | | | | | | | | | | | | | | | | This follows up commit commit 94a520ddbe39ae97de1135d98699cf2674e6b77e and commit 7c5519c12d46ead947d341cbdcbb6fbbe4d4fe1b. After these changes, the default test suites on a cmake -DWITH_UBSAN=ON build no longer fail due to passing null pointers as parameters that are declared to never be null, but plenty of other runtime errors remain.
* | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-10-302-12/+18
|\ \ | |/
| * remove non-working debug assertSergei Golubchik2020-10-291-3/+0
| | | | | | | | | | and restore the test modified in the same commit (the non-replication related deadlock will be reported separately)
| * 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.
* | | Merge 10.2 into 10.3Marko Mäkelä2020-10-281-3/+3
|\ \ \ | |/ /
| * | MDEV-23867: insert... select crash in compute_window_funcVarun Gupta2020-10-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 2 issues here: Issue #1: memory allocation. An IO_CACHE that uses encryption uses a larger buffer (it needs space for the encrypted data, decrypted data, IO_CACHE_CRYPT struct to describe encryption parameters etc). Issue #2: IO_CACHE::seek_not_done When IO_CACHE objects are cloned, they still share the file descriptor. This means, operation on one IO_CACHE may change the file read position which will confuse other IO_CACHEs using it. The fix of these issues would be: Allocate the buffer to also include the extra size needed for encryption. Perform seek again after one IO_CACHE reads the file.
* | | 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-10-222-3/+5
|\ \ \ | |/ /
| * | minor fixes of rpl_start_stop_slave and rpl_slave_grp_exec tests, expanding ↵Alice Sherepa2020-10-141-0/+3
| | | | | | | | | | | | rpl_gtid_delete_domain for easier later analysis
| * | UBSAN UndefinedBehaviorSanitizer: undefined-behavior ../mysys/hash.c:798:9Eugene Kosov2020-10-031-3/+2
| | |
* | | MDEV-23741 Windows : error when renaming file in ALTER TABLEVladislav Vaintroub2020-09-171-3/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presumed reason for the error is that the file was opened by 3rd party antivirus or backup program, causing ERROR_SHARING_VIOLATION on rename. The fix, actually a workaround, is to retry MoveFileEx couple of times before finally giving up. We expect 3rd party programs not to hold file for extended time.
* | | Merge 10.2 into 10.3Marko Mäkelä2020-09-032-4/+8
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2020-09-032-4/+8
| |\ \ | | |/
| | * MDEV-22387: Do not pass null pointer to some memcpy()Marko Mäkelä2020-09-032-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a null pointer to a nonnull argument is not only undefined behaviour, but it also grants the compiler the permission to optimize away further checks whether the pointer is null. GCC -O2 at least starting with version 8 may do that, potentially causing SIGSEGV. These problems were caught in a WITH_UBSAN=ON build with the Bug#7024 test in main.view.
* | | Merge 10.2 into 10.3Marko Mäkelä2020-08-201-117/+16
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2020-08-201-117/+16
| |\ \ | | |/
| | * MDEV-23491: __bss_start breaks compilation of various platformsOleksandr Byelkin2020-08-181-106/+16
| | | | | | | | | | | | Remove __bss_start & Co, because systen call "write" check buffer address and return EFAULT if it is wrong.
* | | Merge branch '10.2' into 10.3mariadb-10.3.24Sergei Golubchik2020-08-061-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2mariadb-10.2.33Sergei Golubchik2020-08-061-1/+1
| |\ \ | | |/
| | * link failure on fulltest (xenial)mariadb-10.1.46Sergei Golubchik2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | depending on build config the error might be hidded, in particular liblz4.so and libjemalloc.so make it to disappear, but with -DWITH_INNODB_LZ4=NO -DWITH_JEMALLOC=NO it reappears.
* | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-08-031-8/+9
|\ \ \ | |/ /
| * | Fix for macOleksandr Byelkin2020-08-021-1/+4
| | |
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-08-021-10/+8
| |\ \ | | |/
| | * MDEV-15961: Fix stacktraces under FreeBSD (aarch64)Karthik Kamath2020-07-281-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Largely based on MySQL commit https://github.com/mysql/mysql-server/commit/75271e51d60bce8683423b208cbb43b11ca6060e MySQL Ref: BUG#24566529: BACKPORT BUG#23575445 TO 5.6 (cut) Also, the PTR_SANE macro which tries to check if a pointer is invalid (used when printing pointer values in stack traces) gave false negatives on OSX/FreeBSD. On these platforms we now simply check if the pointer is non-null. This also removes a sbrk() deprecation warning when building on OS X. (It was before only disabled with building using XCode). Removed execinfo path of MySQL patch that was already included. sbrk doesn't exist on FreeBSD aarch64. Removed HAVE_BSS_START based detection and replaced with __linux__ as it doesn't exist on OSX, Solaris or Windows. __bss_start exists on mutiple Linux architectures. Tested on FreeBSD and Linux x86_64. Being in FreeBSD ports for 2 years implies a good testing there on all FreeBSD architectures there too. MySQL-8.0.21 code is functionally identical to original commit.
* | | Merge 10.2 into 10.3Marko Mäkelä2020-07-311-0/+4
|\ \ \ | |/ /
| * | speed up my_timer_init()Eugene Kosov2020-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | I run perf top during ./mtr testing and constantly see times() function there. It's so slow, that it has no sense to run it in a loop too many times. This patch speeds up -suite=innodb for me from 218s to 208s. 9s of times() function!
* | | MDEV-20377 post-fix: Introduce MEM_MAKE_ADDRESSABLEMarko Mäkelä2020-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In AddressSanitizer, we only want memory poisoning to happen in connection with custom memory allocation or freeing. The primary use of MEM_UNDEFINED is for declaring memory uninitialized in Valgrind or MemorySanitizer. We do not want MEM_UNDEFINED to have the unwanted side effect that AddressSanitizer would no longer be able to complain about accessing unallocated memory. MEM_UNDEFINED(): Define as no-op for AddressSanitizer. MEM_MAKE_ADDRESSABLE(): Define as MEM_UNDEFINED() or ASAN_UNPOISON_MEMORY_REGION(). MEM_CHECK_ADDRESSABLE(): Wrap also __asan_region_is_poisoned().
* | | Merge 10.2 into 10.3Marko Mäkelä2020-05-291-22/+34
|\ \ \ | |/ /
| * | assert(a && b); -> assert(a); assert(b);Sergei Golubchik2020-05-271-22/+34
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2020-05-131-2/+2
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2020-05-131-2/+2
| |\ \ | | |/
| | * MDEV-22344: Fix typos in commentsAnel Husakovic2020-05-061-2/+2
| | |
* | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-05-041-79/+90
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-05-021-79/+90
| |\ \ | | |/
| | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-04-301-79/+90
| | |\
| | | * BUG#30301356 - SOME EVENTS ARE DELAYED AFTER DROPPING EVENTSergei Golubchik2020-04-301-79/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | queues.c cleanup and refactoring. Restore old version of _downhead() (from before cd483c55209) that works well in an average case. Use it for queue_fix(). Move existing specialized version of _downhead() to queue_replace() where it'll be handling the case it was specifically optimized for (moving the element to the end of the queue). And correct it to fix the heap not only down, but also up (this fixes BUG#30301356). Add unit tests. Collateral cosmetic fixes.
| * | | MDEV-20685: compile fixes for Solaris/OSX/AIXDaniel Black2020-04-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sig_return: Solaris/OSX returns different function ptr Move defination to my_alarm.h as its the only use. prevents compile warnings (copied from 10.3 branch) mysys/my_sync.c:136:19: error: 'cur_dir_name' defined but not used [-Werror=unused-const-variable=] 136 | static const char cur_dir_name[]= {FN_CURLIB, 0}; | ^~~~~~~~~~~~ fix compile error (DEPRECATED) leaked from ssl headers. In file included from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:37: /export/home/dan/mariadb-server-10.4/sql/sys_vars.ic:69: error: "DEPRECATED" redefined [-Werror] 69 | #define DEPRECATED(X) X | In file included from /export/home/dan/mariadb-server-10.4/include/violite.h:150, from /export/home/dan/mariadb-server-10.4/sql/sql_class.h:38, from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:36: /usr/include/openssl/ssl.h:2356: note: this is the location of the previous definition 2356 | # define DEPRECATED __attribute__((deprecated)) | Avoid Werror condition on non-Linux: plugin/server_audit/server_audit.c:2267:7: error: variable 'db_len_off' set but not used [-Werror=unused-but-set-variable] 2267 | int db_len_off; | ^~~~~~~~~~ plugin/server_audit/server_audit.c:2266:7: error: variable 'db_off' set but not used [-Werror=unused-but-set-variable] 2266 | int db_off; | ^~~~~~ auth_gssapi fix include path for Solaris Consistent with the upstream packaged patch: https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/database/mariadb-103/patches/06-gssapi.h.patch compile warnings on Solaris [ 91%] Building C object plugin/server_audit/CMakeFiles/server_audit.dir/server_audit.c.o /plugin/server_audit/server_audit.c: In function 'auditing_v8': /plugin/server_audit/server_audit.c:2194:20: error: unused variable 'db_len_off' [-Werror=unused-variable] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ /plugin/server_audit/server_audit.c:2193:20: error: unused variable 'db_off' [-Werror=unused-variable] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2192:20: error: unused variable 'cmd_off' [-Werror=unused-variable] 2192 | static const int cmd_off= 4432; | ^~~~~~~ At top level: /plugin/server_audit/server_audit.c:2192:20: error: 'cmd_off' defined but not used [-Werror=unused-const-variable=] /plugin/server_audit/server_audit.c:2193:20: error: 'db_off' defined but not used [-Werror=unused-const-variable=] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2194:20: error: 'db_len_off' defined but not used [-Werror=unused-const-variable=] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ cc1: all warnings being treated as errors tested on: $ uname -a SunOS openindiana 5.11 illumos-b97b1727bc i86pc i386 i86pc
* | | | Merge 10.2 into 10.3Marko Mäkelä2020-04-271-7/+7
|\ \ \ \ | |/ / /
| * | | cleanup THR_KEY_mysysEugene Kosov2020-04-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read TLS with my_thread_var write TLS with set_mysys_var() my_thread_var is no longer __attribute__ ((const)): this attribute is simply incorrect here. Read gcc manual for more information. sql/threadpool_generic.cc fails with that attribute.
* | | | Merge 10.2 into 10.3Marko Mäkelä2020-04-153-8/+22
|\ \ \ \ | |/ / /
| * | | Correct FreeBSD cpuset_t typeDaniel Black2020-04-031-0/+4
| | | |
| * | | A better fix for edd7e7cSergey Vojtovich2020-04-011-9/+11
| | | |
| * | | MDEV-22074 UBSAN: applying zero offset to null pointer in hash.cEugene Kosov2020-03-311-1/+7
| | | | | | | | | | | | | | | | The fix: return fast when no work should be performed.
| * | | MDEV-22069 UBSAN: runtime error: member access within null pointer of type ↵Eugene Kosov2020-03-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 'MY_DIR_HANDLE' in mysys/my_lib.c This is an error handling bug. When opendir() fails dirh is NULL and we shouldn't try to free it.
* | | | Merge branch '10.2' into 10.3Vicențiu Ciorbaru2020-03-081-21/+23
|\ \ \ \ | |/ / /
| * | | Check for CPU_COUNT macro within my_getncpusVicențiu Ciorbaru2020-03-081-21/+23
| | | | | | | | | | | | | | | | | | | | * Small refactor of my_getncpus function to compile for very old glibc < 2.6. * Cleanup code to eliminate duplication.