10 Commits

Author SHA1 Message Date
40be423f08 Fix miscellaneous typos 2025-07-13 18:42:30 +03:00
fc49fa706d CONC-618: Please annotate swapcontext for ASAN
When compiling for AddressSanitizer, prefer the system ucontext or
boost::context co-routine libraries over our custom assembler routines. The
custom routines are not easily annotated with the required AddressSanitizer
__sanitizer_{start,finish}_switch_fiber() functions, while the system
routines should already be so annotated.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-02-05 16:08:25 +01:00
da0a01367c Implement boost::context as a fallback for non-blocking API support
The non-blocking API has native (assembler) implementations for x86_64,
i386, and (with recent patch) aarch64; these implementations are the most
efficient. For other architectures, a fallback to ucontext is supported.

But ucontext is not the most efficient, and it is not available on all
platforms (it has been deprecated in POSIX). The boost::context library
provides an alternative fallback that is available on more architectures and
should be more efficient than ucontext (if still not quite as fast as the
native support).

This patch adds a CMake option -DWITH_BOOST_CONTEXT=ON that adds
boost::context as a dependency of libmariadb to provide a fallback on
non-natively supported architectures. Boost::context is preferred over
ucontext when both are available.

The option is off by default and must be explicitly enabled by the
user. This avoids introducing a C++ dependency (including dependency
on a C++ compiler and on libstdc++) unless explicitly requested by the
user (libmariadb is otherwise C-only).

Tested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-09-27 15:33:43 +02:00
d2285fb830 MDEV-34859: Failed to initialise non-blocking API on OpenBSD arm64
Implement native my_context for arm64 (aarch64). This is more
efficient than ucontext, and also makes the non-blocking API available
on arm64 platforms that do not have ucontext such as OpenBSD.

Tested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-09-27 15:32:43 +02:00
274f2face2 Merge pull request #199 from hyung-hwan/3.3
enhanced mysql_close_slow_part() and other related parts to prevent memory leaks in the non-blocking mode
2022-07-25 09:22:04 +02:00
3f7719c74d Typo fixes (from PR #200) 2022-06-27 13:23:35 +02:00
c0fea17e2a enhanced mysql_close() and other related parts to prevent memory leaks when terminating an initiated but unestablished connection 2022-06-21 17:49:45 +09:00
d706eaf90a PR 172
Fix Sigbus when calling mysql_real_connect_start on ARM/MacOS
2022-03-03 06:43:21 +01:00
0b46f1ae42 Fix for CONC-521
On macOS, the ucontext functions require _XOPEN_SOURCE to be defined
before including ucontext.h. (Any value is fine, but it's supposed to
be a POSIX-defined number, and 600 seems like the most common choice.)
These functions are required for MYSQL_OPT_NONBLOCK to work on non-x86
platforms, e.g. Apple's M1 chip. This change sets _XOPEN_SOURCE to 600
on Apple platforms during CMake's feature detection and before including
<ucontext.h> in ma_context.h.

Thanks to Evan Miller for reporting this bug and providing the fix.
2021-01-21 16:56:48 +01:00
4ca933bb81 Global cleanup:
removed global locks
  removed dead code and files
  removed dbug
2016-02-08 18:43:02 +01:00