summaryrefslogtreecommitdiff
path: root/sql/signal_handler.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2023-04-111-15/+18
|\
| * Merge remote-tracking branch '10.4' into 10.5Oleksandr Byelkin2023-03-311-14/+18
| |\
| | * MDEV-30613 output_core_info crashes in my_read()Daniel Black2023-03-081-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and my_getwd(). The cause is my_errno define which depends on my_thread_var being a not null pointer otherwise it will be de-referenced and cause a SEGV already in the signal handler. Replace uses of these functions in the output_core_info using posix read/getcwd functions instead. The getwd fallback in my_getcwd isn't needed as its been obsolute for a very long time. Thanks Vladislav Vaintroub for diagnosis and posix recommendation.
* | | Merge 10.5 into 10.6Marko Mäkelä2023-01-131-1/+3
|\ \ \ | |/ /
| * | Merge 10.4 into 10.5Marko Mäkelä2023-01-131-1/+3
| |\ \ | | |/
| | * Merge branch '10.3' into 10.4Sergei Golubchik2023-01-101-1/+3
| | |\
| | | * MDEV-17093: SOURCE_REVISION in log and handle_fatal_signalHaidong Ji2023-01-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB MDEV-12583 added `SOURCE_REVISION` variable that exposes the SHA1 of source code commit that the current running engine was built from. This info is useful for troubleshooting and debugging. This commit does the following: - addes the `SOURCE_REVISION` value into engine error log. - when a crash triggers handle_fatal_signal, the `SOURCE_REVISION` will be included in crash report. - resolves MDEV-20344: startup messages belong in stderr/error-log not stdout All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-06-271-0/+10
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-06-271-0/+10
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2022-06-271-0/+10
| | |\ \ | | | |/
| | | * MDEV-28884: include kernel information in crashing signal handlerDaniel Black2022-06-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent adventures in liburing and btrfs have shown up some kernel version dependent bugs. Having a bug report of accurace kernel version can start to correlate these errors sooner. On Linux, /proc/version contains the kernel version. FreeBSD has kern.version (per man 8 sysctl), so include that too. Example output: Max nice priority 0 0 Max realtime priority 0 0 Max realtime timeout unlimited unlimited us Core pattern: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h Kernel version: Linux version 5.19.0-0.rc2.21.fc37.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1), GNU ld version 2.38-14.fc37) #1 SMP PREEMPT_DYNAMIC Mon Jun 13 15:27:24 UTC 2022 Segmentation fault (core dumped)
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-071-7/+9
|\ \ \ \ | |/ / /
| * | | Fix a false positive GCC5 warning.Vladislav Vaintroub2021-09-061-7/+9
| | | |
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-09-061-12/+11
|\ \ \ \ | |/ / /
| * | | MDEV-26533 fixup: GCC -WformatMarko Mäkelä2021-09-061-2/+2
| | | |
| * | | MDEV-26533 MariaDB 10.5 crashes with key_buffer_size > 4Gb on Windows x64Vladislav Vaintroub2021-09-041-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a side-effect of my_large_malloc() introduction,MDEV-18851 It removed a cast to size_t to variable 'blocks' in multiplication blocks * keycache->key_cache_block_size , creating ulong value instead of correct size_t. Replaced a couple of ulongs with appropriate data type, which is size_t. Also, fixed casts to ulongs in crash handler messages, so that people would not be confused by that, too. Interestingly, aria did not expose the same problem even if it contains copied and pasted code in ma_pagecache, because Aria had some ulongs removed when fixing a similar problem in MDEV-9256.
* | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2021-08-021-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.4' into 10.5Oleksandr Byelkin2021-07-311-1/+1
| |\ \ \ | | |/ /
| | * | cleanup: move thread_count to THD_count::value()Sergei Golubchik2021-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | because the name was misleading, it counts not threads, but THDs, and as THD_count is the only way to increment/decrement it, it could as well be declared inside THD_count.
* | | | MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* | | | Added checking to protect against simultaneous double free in safemallocMonty2021-05-191-3/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two threads would call sf_free() / free_memory() at the same time, bad_ptr() would not detect this. Fixed by adding extra detection when working with the memory region under sf_mutex. Other things: - If safe_malloc crashes while mutex is hold, stack trace printing will hang because we malloc is called by my_open(), which is used by stack trace printing code. Fixed by adding MY_NO_REGISTER flag to my_open, which will disable the malloc() call to remmeber the file name.
* | | Merge 10.4 into 10.5Marko Mäkelä2021-04-211-3/+3
|\ \ \ | |/ /
| * | Merge 10.3 into 10.4Marko Mäkelä2021-04-211-3/+3
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2021-04-211-3/+3
| | |\
| | | * signal handler, display coredump file pattern similarly to MDEV-25294 but ↵David Carlier2021-04-151-3/+3
| | | | | | | | | | | | | | | | for FreeBSD, thankfully the sysctl OID is the same.
* | | | Merge 10.4 into 10.5Marko Mäkelä2021-03-311-1/+13
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2021-03-311-1/+13
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2021-03-311-1/+13
| | |\ \ | | | |/
| | | * MDEV-25294 signal handler display coredump on macDavid CARLIER2021-03-301-1/+13
| | | |
* | | | Merge branch '10.4' into 10.5Sergei Golubchik2021-02-231-1/+2
|\ \ \ \ | |/ / /
| * | | In case of an abort, write "handling fatal signal" to DBUG log.Monty2021-02-141-1/+2
| |/ /
* | | Merge 10.4 into 10.5Marko Mäkelä2020-07-021-1/+1
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2020-07-021-1/+1
| |\ \ | | |/
| | * Merge 10.1 into 10.2bb-10.2-mergeMarko Mäkelä2020-07-011-1/+1
| | |\
| | | * signal handler: use mariadb kb URL rather than MySQL oneDaniel Black2020-06-291-1/+1
| | | |
* | | | Fixed access to undefined memory found by valgrind and MSANMonty2020-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When my_vsnprintf() is patched, the code protected disabled with 'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b formats in this patch should be revert to %s again
* | | | output_core_info - freebsd rlimits in different proc entryDaniel Black2020-04-031-0/+4
| | | |
* | | | Bug#18913935: REMOVE SUPPORT FOR LINUXTHREADSJon Olav Hauglid2020-03-101-18/+0
|/ / / | | | | | | | | | | | | This patch removes support for LinuxThreads. It was superseded by NPTL in Linux 2.6 (2003).
* | | 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
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-05-021-4/+42
|\ \ \ \ | |/ / /
| * | | MDEV-15051: signal handler - output information about the core generationDaniel Black2019-05-011-4/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The working directory, resource limits and core pattern will aid the user finding a core file in the case of failure. While the core file size is most relevant however other resource limits may give a clue as the the cause of the fatal signal so include them also. As signal handler functions are limited, proc filesystem reads/ readlink calls are used instead of the more obvious getcwd/getrlimits functions which aren't listed as signal safe. Results in output of the form: Writing a core file: working directory at /tmp/datadir Resource Limits: Limit Soft Limit Hard Limit Units Max cpu time unlimited unlimited seconds Max file size unlimited unlimited bytes Max data size unlimited unlimited bytes Max stack size 8388608 unlimited bytes Max core file size unlimited unlimited bytes Max resident set unlimited unlimited bytes Max processes 47194 47194 processes Max open files 1024 4096 files Max locked memory 65536 65536 bytes Max address space unlimited unlimited bytes Max file locks unlimited unlimited locks Max pending signals 47194 47194 signals Max msgqueue size 819200 819200 bytes Max nice priority 0 0 Max realtime priority 0 0 Max realtime timeout unlimited unlimited us Core pattern: |/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %P %I Segmentation fault (core dumped) Closes #537
* | | | Make possible to use clang on Windows (clang-cl)Vladislav Vaintroub2018-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | -DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-1/+3
|\ \ \ \ | |/ / /
| * | | Write location of core when doing core dumpMonty2018-01-011-1/+3
| | | |
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-011-0/+4
|\ \ \ \ | |/ / /
| * | | Fix threadpool to report connections aborted due to wait timeout.Vladislav Vaintroub2017-08-301-0/+4
| | | | | | | | | | | | | | | | Update wait_timeout.test to add test case for this.
* | | | Added DBUG_ASSERT_AS_PRINTF compile flagMonty2017-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.