summaryrefslogtreecommitdiff
path: root/mysys
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-24556: Build does not recognize powerpc64 (OpenBSD)Brad Smith2021-01-111-1/+1
| | | | Reviewer: Daniel Black
* Merge commit '10.4' into 10.5Oleksandr Byelkin2021-01-061-1/+0
|\
| * Merge branch '10.3' into 10.4bb-10.4-MDEV-23468Oleksandr Byelkin2020-12-251-1/+1
| |\
| | * 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.
* | | | MDEV-22929 fixup: root_name() clash with clang++ <fstream>Marko Mäkelä2020-12-031-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang++ -stdlib=libc++ header file <fstream> depends on <filesystem> that defines a member function path::root_name(), which conflicts with the rather unused #define root_name() that had been introduced in commit 7c58e97bf6f80a251046c5b3e7bce826fe058bd6. Because an instrumented -stdlib=libc++ (rather than the default -stdlib=libstdc++) is easier to build for a working -fsanitize=memory (cmake -DWITH_MSAN=ON), let us remove the conflicting #define for now.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-12-021-0/+2
|\ \ \ \ | |/ / /
| * | | MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restoreSujatha2020-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== When O_TMPFILE is not supported mysqlbinlog outputs the error to standard stream as a warning which breaks PITR: ERROR 1064 (42000) at line 382: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts) Analysis: ========= 'mysqlbinlog' utility is used to perform point-in-time-recovery based on binary log. It converts the events in the binary log files, from binary format to text so that they can be viewed or applied. This output can be saved to a file and it can be sourced back to mysql client. The mysqlbinlog utility stores the text output into IO_CACHE and when it is full the data is written to a temp file. The temporary file creation is attempted using 'O_TMPFILE' flag. If the underlying filesystem doesn't support this operation, a note is printed on to standard error and file creation is done without O_TMPFILE' flag. If standard error is redirected to standard output the note gets written to the sql file as shown below. /bld/client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future attempts) table id 32 When the sql file is used for PITR, it leads to a syntax error as it is not a valid sql command. Fix: ==== Make 'my_message_stderr' to ignore messages which are flagged as ME_NOTE and ME_ERROR_LOG_ONLY. ME_ERROR_LOG_ONLY flag is applicable to server. In order to print an informational note to stderr stream, ME_NOTE flag without ME_ERROR_LOG_ONLY flag should be specified. 'my_message_stderr' should print messages flagged with ME_WARNING or ME_FATAL to stderr stream.
* | | | Fixed compiler warnings from crc32c.ccMonty2020-11-261-6/+7
| | | |
* | | | MDEV-24125: linux large pages, linux/mman.h neededDaniel Black2020-11-191-0/+3
| | | | | | | | | | | | | | | | | | | | Centos/RHEL7 have the MAP_HUGE_SHIFT constant defined in linux/mman.h which needed to get included.
* | | | MDEV-24125: allow compile on Linux headers < 3.8Daniel Black2020-11-171-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows MariaDB to compile on old (limits to >2.6.32) linux kernel versions. This warns that attempts to use large pages will rely on implict kernel determination.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-11-032-3/+4
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-11-034-15/+22
| |\ \ \ | | |/ /
| | * | 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.4' into 10.5Oleksandr Byelkin2020-11-012-11/+18
|\ \ \ \
| * \ \ \ Merge branch '10.3' into 10.4Oleksandr Byelkin2020-10-312-12/+18
| |\ \ \ \ | | |/ / / | |/| / / | | |/ /
| | * | 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.4 into 10.5Marko Mäkelä2020-10-302-4/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-10-292-4/+4
| |\ \ \ \ | | |/ / /
| | * | | 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.4 to 10.5Marko Mäkelä2020-10-222-4/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-10-222-3/+5
| |\ \ \ \ | | |/ / /
| | * | | 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
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-09-231-3/+56
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-09-211-3/+56
| |\ \ \ \ | | |/ / /
| | * | | 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.
* | | | | MDEV-19935 Create unified CRC-32 interfaceVladislav Vaintroub2020-09-179-720/+2010
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add CRC32C code to mysys. The x86-64 implementation uses PCMULQDQ in addition to CRC32 instruction after Intel whitepaper, and is ported from rocksdb code. Optimized ARM and POWER CRC32 were already present in mysys.
* | | | | MDEV-23680 Assertion `data' failed in crcr32_calc_pclmulqdqVladislav Vaintroub2020-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | Fix DBUG_ASSERT
* | | | | MDEV-22749 Implement portable PCLMUL accelerated crc32() with Intel intrinsicsVladislav Vaintroub2020-09-042-510/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed some inine assembly, replaced by code from https://github.com/intel/soft-crc Also,replace GCC inline assembly for cpuid in ut0crc32 with __cpuid, to fix "PIC register clobbered by 'ebx' in 'asm'. This enables fast CRC32C on 32bit Intel processors with GCC.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-09-042-4/+8
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-09-032-4/+8
| |\ \ \ \ | | |/ / /
| | * | | 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.
* | | | | MDEV-23618 InnoDB lacks IA-32 CRC-32C acceleration on GCC 4Marko Mäkelä2020-08-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When MDEV-22669 introduced CRC-32C acceleration to IA-32, it worked around a compiler bug by disabling the acceleration on GCC 4 for IA-32 altogether, even though the compiler bug only affects -fPIC builds that are targeting IA-32. Let us extend the solution fe5dbfe723427a3606c41409626dc853f997e679 and define HAVE_CPUID_INSTRUCTION that allows us to implement a necessary and sufficient work-around of the compiler bug.
* | | | | MDEV-23585: Fix the 32-bit build on GCC 4Marko Mäkelä2020-08-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC before version 5 would fail to emit the CPUID instruction when targeting IA-32 in -fPIC mode. Therefore, we must add the CPUID instruction to the HAVE_CLMUL_INSTRUCTION check. This means that the PCLMUL accelerated crc32() function will not be available on i686 executables that are compiled with GCC 4. The limitation does not impact AMD64 builds or non-PIC x86 builds, or other compilers (clang, or GCC 5 or newer).
* | | | | MDEV-23585: Fix HAVE_CLMUL_INSTRUCTIONMarko Mäkelä2020-08-273-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-22641 in commit dec3f8ca69e5eb19a4be7a175d3834874c4d880b refactored a SIMD implementation of CRC-32 for the ISO 3309 polynomial that uses the IA-32/AMD64 carry-less multiplication (pclmul) instructions. The code was previously only available in Mariabackup; it was changed to be a general replacement of the zlib crc32(). There exist AMD64 systems where CMAKE_SYSTEM_PROCESSOR matches the pattern i[36]86 but not x86_64 or amd64. This would cause a link failure, because mysys/checksum.c would basically assume that the compiler support for instruction is always available on GCC-compatible compilers on AMD64. Furthermore, we were unnecessarily disabling the SIMD acceleration for 32-bit executables. Note: Until MDEV-22749 has been implemented, the PCLMUL instruction will not be used on Microsoft Windows. Closes: #1660
* | | | | MDEV-23495: Refine Arm64 PMULL runtime check in MariaDBYuqi Gu2020-08-211-239/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raspberry Pi 4 supports crc32 but doesn't support pmull (MDEV-23030). The PR #1645 offers a solution to fix this issue. But it does not consider the condition that the target platform does support crc32 but not support PMULL. In this condition, it should leverage the Arm64 crc32 instruction (__crc32c) and just only skip parallel computation (pmull/vmull) rather than skip all hardware crc32 instruction of computation. The PR also removes unnecessary CRC32_ZERO branch in 'crc32c_aarch64' for MariaDB, formats the indent and coding style. Change-Id: I76371a6bd767b4985600e8cca10983d71b7e9459 Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
* | | | | Added DBUG_PUSH_EMPTY and DBUG_POP_EMPTY to speed up DBUGMonty2020-08-201-2/+2
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-08-201-126/+26
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-08-201-117/+16
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.2 into 10.3Marko Mäkelä2020-08-201-117/+16
| | |\ \ \ | | | |/ /