MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
Martin Beck 4e0dcf1083 MDEV-27088: Server crash on ARM (WMM architecture) due to missing barriers in lf-hash
MariaDB server crashes on ARM (weak memory model architecture) while
concurrently executing l_find to load node->key and add_to_purgatory
to store node->key = NULL. l_find then uses key (which is NULL), to
pass it to a comparison function.

The specific problem is the out-of-order execution that happens on a
weak memory model architecture. Two essential reorderings are possible,
which need to be prevented.

a) As l_find has no barriers in place between the optimistic read of
the key field lf_hash.cc#L117 and the verification of link lf_hash.cc#L124,
the processor can reorder the load to happen after the while-loop.

In that case, a concurrent thread executing add_to_purgatory on the same
node can be scheduled to store NULL at the key field lf_alloc-pin.c#L253
before key is loaded in l_find.

b) A node is marked as deleted by a CAS in l_delete lf_hash.cc#L247 and
taken off the list with an upfollowing CAS lf_hash.cc#L252. Only if both
CAS succeed, the key field is written to by add_to_purgatory. However,
due to a missing barrier, the relaxed store of key lf_alloc-pin.c#L253
can be moved ahead of the two CAS operations, which makes the value of
the local purgatory list stored by add_to_purgatory visible to all threads
operating on the list. As the node is not marked as deleted yet, the
same error occurs in l_find.

This change three accesses to be atomic.

* optimistic read of key in l_find lf_hash.cc#L117
* read of link for verification lf_hash.cc#L124
* write of key in add_to_purgatory lf_alloc-pin.c#L253

Reviewers: Sergei Vojtovich, Sergei Golubchik

Fixes: MDEV-23510 / d30c1331a18d875e553f3fcf544997e4f33fb943
2021-11-30 11:30:52 +11:00
BUILD Updated BUILD/SETUP from MariaDB 10.5 2019-09-01 19:17:34 +03:00
client MDEV-19129: Xcode compatibility update: #include <editline/readline.h> path 2021-10-31 00:24:26 +03:00
cmake MDEV-22522 RPM packages have meaningless summary/description 2021-11-23 11:29:24 +07:00
dbug cmake: fewer Build-Depends in SRPM 2021-05-22 21:56:51 +02:00
debian Unused flag creates cleaning issue (piuparts) 2021-08-20 12:44:05 +03:00
Docs MDEV-19563 Removed references to deprecated option innodb_locks_unsafe_for_binlog 2019-06-12 13:00:08 +03:00
extra MDEV-26558 Fix a deadlock due to cyclic dependence 2021-11-24 12:57:44 +02:00
include pthread_yield() is depricated now, so use sched_yield() if possible. 2021-10-26 15:05:13 +02:00
libmariadb@735a7299db Update libmariadb 2021-10-20 16:04:29 +03:00
libmysqld cleanup: fix and generalize handle_manager thread 2021-01-24 11:35:55 +01:00
libservices Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
man MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs 2021-10-07 11:30:22 -06:00
mysql-test MDEV-26553 NOT IN subquery construct crashing 10.1 and up 2021-11-26 13:02:39 -08:00
mysys MDEV-27088: Server crash on ARM (WMM architecture) due to missing barriers in lf-hash 2021-11-30 11:30:52 +11:00
mysys_ssl MDEV-23925: Fixed warnings generated during compilation of mysys_ssl/openssl.c on MacOS 2020-10-21 17:43:23 +07:00
pcre Merge remote-tracking branch 'merge/merge-pcre' into 10.2 2021-07-27 18:51:32 +02:00
plugin MDEV-22522 RPM packages have meaningless summary/description 2021-11-23 11:29:24 +07:00
randgen/conf
scripts mysql_install_db: remove MySQL references 2021-11-24 17:19:55 +11:00
sql MDEV-26553 NOT IN subquery construct crashing 10.1 and up 2021-11-26 13:02:39 -08:00
sql-bench Merge 10.1 into 10.2 2020-07-01 12:03:55 +03:00
sql-common UBSAN: Fix a bit shift overflow 2020-09-23 12:42:30 +03:00
storage MDEV-22522 RPM packages have meaningless summary/description 2021-11-23 11:29:24 +07:00
strings MDEV-24335 Unexpected question mark in the end of a TINYTEXT column 2021-11-02 09:00:49 +04:00
support-files MDEV-26612 Two different ways to start MariaDB service can cause data corruption 2021-09-24 15:02:47 +07:00
tests mysql_client_test: test_bug40365 gcc-11.2.1 indentation complaint 2021-08-15 09:00:08 +10:00
unittest MDEV-24131: unittest stacktrace-t fails to compile (OpenBSD) 2021-01-28 13:27:00 +11:00
vio Cleanup - reduce duplicate code, in SSL IO error handling. 2021-03-25 11:16:54 +01:00
win MDEV-27056 Windows upgrade_wizard - CloseHandle() on invalid (already closed) pipe handle 2021-11-16 01:51:35 +01:00
wsrep Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
zlib MDEV-24034 Policy CMP0075 is not set during compile 2020-12-15 12:27:13 +01:00
.clang-format .clang-format - do not sort include files. 2019-12-03 22:22:23 +01:00
.gitattributes
.gitignore Xcode compatibility update 2021-10-12 18:10:56 -04:00
.gitmodules
.travis.compiler.sh
.travis.yml Travis-CI: Remove builds that always fail to make CI useful again 2020-05-17 15:52:35 +03:00
appveyor.yml appveyor - do not use buggy cygwin bison. 2021-11-04 07:34:55 +01:00
BUILD-CMAKE
CMakeLists.txt Define minbuild target for 10.2 2021-09-11 15:19:42 +02:00
config.h.cmake Replace mallinfo with mallinfo2 on supported systems 2021-03-27 08:40:04 +11:00
configure.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
COPYING Update FSF Address 2019-05-11 21:29:06 +03:00
CREDITS Update sponsors 2021-03-12 07:02:29 +11:00
INSTALL-SOURCE
INSTALL-WIN-SOURCE
KNOWN_BUGS.txt
README.md Remove Travis CI status 2021-06-21 08:18:34 +03:00
THIRDPARTY Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
VERSION bump the VERSION 2021-11-08 11:26:47 -05:00

Code status:

  • Appveyor CI status ci.appveyor.com

MariaDB: drop-in replacement for MySQL

MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.

MariaDB is brought to you by the MariaDB Foundation. Please read the CREDITS file for details about the MariaDB Foundation, and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle Corporation, Inc. For a list of developers and other contributors, see the Credits appendix. You can also run 'SHOW authors' to get a list of active contributors.

A description of the MariaDB project and a manual can be found at:

https://mariadb.org/

https://mariadb.com/kb/en/

https://mariadb.com/kb/en/mariadb-vs-mysql-features/

https://mariadb.com/kb/en/mariadb-versus-mysql-features/

https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

As MariaDB is a full replacement of MySQL, the MySQL manual at http://dev.mysql.com/doc is generally applicable.

Help:

More help is available from the Maria Discuss mailing list https://launchpad.net/~maria-discuss and the #maria IRC channel on Freenode.

Licensing:


NOTE:

MariaDB is specifically available only under version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.) This is inherited from MySQL. Please see the README file in the MySQL distribution for more information.

License information can be found in the COPYING file. Third party license information can be found in the THIRDPARTY file.


Bug Reports:

Bug and/or error reports regarding MariaDB should be submitted at: https://jira.mariadb.org

For reporting security vulnerabilities see: https://mariadb.org/about/security-policy/

Bugs in the MySQL code can also be submitted at: https://bugs.mysql.com

The code for MariaDB, including all revision history, can be found at: https://github.com/MariaDB/server