Commit graph

139 commits

Author SHA1 Message Date
Marko Mäkelä
68e6c2d768 MDEV-20377: Introduce cmake -DWITH_MSAN:BOOL=ON
MemorySanitizer is a compile-time instrumentation layer in clang and GCC.
Together with AddressSanitizer mostly makes the run-time instrumentation
of Valgrind redundant. It is a little more tricky to set up, because
running with uninstrumented libraries will lead into false positives.

You will need an instrumented libc++, and you should use
-stdlib=libc++ instead of the default libstdc++. To build the
instrumented library, you can refer to
https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo
or you can adapt these steps that worked for me, for clang-8 version 8.0.1:

cd /mariadb
sudo apt source libc++-8-dev
cd llvm-toolchain-8-8.0.1
mkdir libc++msan; cd libc++msan
cmake ../libcxx -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory \
-DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8

Then, in your MariaDB build directory, you have to compile with
libc++ and bundled libraries, such as WITH_SSL=bundled, WITH_ZLIB=bundled.
For uninstrumented system libraries, you will get false positives for
uninitialized values. Like this:

cmake -DWITH_MSAN=ON -DWITH_SSL=bundled -DWITH_ZLIB=bundled \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' ..

Note: you should also add -O2 to the compiler options, or you may
get crashes due to stack overflow.

Finally, to run tests, you must replace libc++ with the instrumented one:

LD_LIBRARY_PATH=/mariadb/llvm-toolchain-8-8.0.1/libc++msan/lib \
MSAN_OPTIONS=abort_on_error=1 \
./mtr --big-test --parallel=auto --force --retry=0

Failure to do so will report numerous false positives related to
operations on std::string and the like.

This is work in progress. Some issues will still have to be fixed
for WITH_MSAN to be usable. See MDEV-20377 for details.
2019-08-19 20:56:26 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Sergei Golubchik
f2a0c758da Merge branch '10.1' into 10.2 2019-03-29 10:58:20 +01:00
Sergei Golubchik
6417297180 cmake: remove workarounds for cmake bugs #13248 and #12864
since long we use a different workaround, our own CPackRPM wrapper
2019-03-27 22:51:37 +01:00
Marko Mäkelä
3ea49d35bd Merge 10.1 into 10.2 2019-03-11 11:45:33 +02:00
Eugene Kosov
2a2ab121b0 MDEV-17703 Add WITH_UBSAN switch to CMake similar to WITH_ASAN
This can be useful:
UBSAN_OPTIONS=log_path=/some/path

clang users may want to increase stack size in include/my_pthread.h or enable
some optimizations
2019-03-11 13:37:19 +04:00
Marko Mäkelä
1a5028f430 Fix the WITH_ASAN clang build of dynamic plugins 2019-03-07 14:32:20 +02:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Sergei Golubchik
44f6f44593 Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
Sergei Golubchik
37ab7e4596 Merge branch '5.5' into 10.0 2018-10-27 20:46:38 +02:00
Sergei Golubchik
f9e5195b40 Merge branch 'mysql/5.5' into 5.5 2018-10-23 15:59:24 +02:00
Sergei Golubchik
21d157abaa MDEV-14560 Extra engines enabled through additional config are not loaded on first installation
RPM solution:

Make all server plugins to restart the server when installed.
To avoid multiple server restarts, do it only once in posttrans scriptlet.
Add support for CPACK_RPM_<component>_POST_TRANS_SCRIPT_FILE
2018-09-21 13:31:37 +02:00
Sergei Golubchik
5c83305c4c RPM: generate per-plugin.cnf files where git will ignore them 2018-09-21 13:31:37 +02:00
Aditya A
c54271723c Bug #26275510 BUNDLED ZLIB DOESN'T INCLUDE FIXES FOR SOME VULNERABILITIES
Upgrading the zlib lib to 1.2.11
2018-07-09 17:25:49 +05:30
Sergei Golubchik
76056559ac MDEV-9869 INSTALL SONAME 'ha_connect'
fix 011497bd60

in RPM and DEB: storage engine packages must require the server
package of exactly correct version.
2017-12-25 12:00:52 +01:00
Vicențiu Ciorbaru
22c322c649 Merge branch '10.1' into 10.2 2017-09-19 12:43:02 +03:00
Vicențiu Ciorbaru
ec6042bda0 Merge branch '10.0' into 10.1 2017-09-19 12:06:50 +03:00
Sergei Golubchik
79ddd86615 bugfix: don't overwrite tokudb.cnf during the build 2017-09-18 10:12:23 +02:00
Vladislav Vaintroub
a46679dcf7 Build improvements and cleanups.
- the probably ultimate fix for dependencies on VS
- remove some GET_TARGET_PROPERTY(LOCATION ...), they are deprecated in
cmake 3.9
- simplify signing targets on Windows.
- remove INSTALL_DEBUG_TARGET, we do not mix binaries from different builds
in the same package
2017-09-08 18:22:15 +00:00
Marko Mäkelä
14c6f00a9f Merge 10.1 into 10.2
Also, include fixes by Vladislav Vaintroub to the
aws_key_management plugin. The AWS C++ SDK specifically depends on
OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
2017-05-06 14:36:46 +03:00
Vladislav Vaintroub
7bf409593e MDEV-11660 Make encryption plugins "pure"
Do not exporting mysqld entry points directly.
This is needed for mariabackup, to load encryption plugins on Windows.

All plugins are "pure" by default. To mark plugin "impure"
it should use RECOMPILE_FOR_EMBEDDED or STORAGE_ENGINE keyword.
2017-04-27 19:12:38 +02:00
Vladislav Vaintroub
73c57e2be7 Fix building aws_key_management on Linux
in MYSQL_ADD_PLUGIN, do not add TARGET_LINK_LIBRARIES twice for the LINK_LIBRARIES parameter
It is usually harmless to add libraries twice.

However, aws_key_management uses -Wl,-whole-archive to workaround linker issues on Linux
If libraries are added twice with whole-archive, linking will fail complaining about duplicate symbols
2017-04-06 23:11:57 +00:00
Vladislav Vaintroub
d235782fca Merge branch '10.1' into 10.2 2017-04-06 09:51:35 +00:00
Vladislav Vaintroub
b666732182 Do not link client plugins to mysqld
they might not be able to load after this.
2017-04-06 09:50:27 +00:00
Marko Mäkelä
1494147cf6 Merge 10.1 into 10.2 2017-04-06 09:52:25 +03:00
Marko Mäkelä
8d4871a953 Merge 10.0 into 10.1 2017-04-06 08:53:59 +03:00
Vladislav Vaintroub
f2dc04abea Compiling, Windows . Avoid unnecessary rebuilds with MSVC.
To export symbols from the mysqld.exe, use lib.exe with /DEF, rather than
pre-link step when building mysqld.exe.

This helps to avoid relinking all plugins, if mysqld.exe was recompiled
but the list of its exports has not changed.

Also removed unnecessary DEPENDS in some ADD_CUSTOM_COMMAND (gen_lex_token,
gen_lex_hash etc). They confuse VS generator which tends to
recreate headers and do unnecessary recompilations.
2017-04-03 18:48:48 +00:00
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
Sergei Golubchik
269ab56f8b small plugin API related fixes
* define MYSQL_DYNAMIC_PLUGIN only for server plugins
* don't typedef my_bool in mysql.h if plugin.h has already done it
* fix the include guard in plugin.h
2017-03-10 18:21:28 +01:00
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Sergei Golubchik
9c38308d8f MDEV-10086 no gssapi-server RPM package anymore in 10.1
set CPACK_COMPONENTS_ALL both on the current and parent scope
2016-06-28 12:54:01 +02:00
Sergei Golubchik
4025251efd fix rpm installation issues on Fedoras 2016-05-05 12:29:40 +02:00
Sergei Golubchik
87e3e67f43 Merge branch '10.0' into 10.1 2016-05-04 15:23:26 +02:00
Sergei Golubchik
011497bd60 MDEV-9869 INSTALL SONAME 'ha_connect'
make storage engine RPMs require the exact server
version RPM: "MariaDB = %{version}-%{release}",
other plugins require simply "MariaDB", as before.
2016-04-24 18:15:20 +02:00
Sergei Golubchik
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
Vladislav Vaintroub
517584dde0 Provide a way to reenable DISABLED plugin with -DPLUGIN_${NAME}=STATIC|DYNAMIC 2016-03-13 20:26:21 +01:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Vladislav Vaintroub
b128f26cd5 Fix build : change MYSQL_ADD_PLUGIN to be MACRO again, rather than FUNCTION 2016-02-22 18:11:59 +01:00
Vladislav Vaintroub
c20979b163 MDEV-9601 Build client plugins, also for the cmake client-only build
(-DWITHOUT_SERVER=1)
2016-02-22 16:26:44 +01:00
Sergei Golubchik
74d86d1d27 MYSQL_ADD_PLUGIN: fix DISABLED keyword to work 2016-02-17 15:11:05 +01:00
Monty
b2f8d7b410 Merge branch '10.1' into 10.2
Conflicts:
	VERSION
	cmake/plugin.cmake
	config.h.cmake
	configure.cmake
	plugin/server_audit/server_audit.c
	sql/sql_yacc.yy
2016-02-06 18:14:54 +02:00
Vladislav Vaintroub
a095c99301 Fix packaging for client RPM plugins - provide 'ignored' list 2016-01-26 17:56:41 +01:00
Vladislav Vaintroub
4bb62e91f6 Do not require server RPM for client plugins 2016-01-20 14:35:11 +01:00
Vladislav Vaintroub
67cf76ad9b MDEV 4691- address review comments 2016-01-19 11:59:32 +01:00
Sergei Golubchik
4f84d9ce88 cmake: MYSQL_PARSE_ARGUMENTS -> CMAKE_PARSE_ARGUMENTS 2015-11-23 16:02:56 +01:00
Sergei Golubchik
d7e7862364 Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
Sergei Golubchik
db227616d2 followup for "MDEV-6248 GUI-friendly cmake options to enable/disable plugins"
Remove ONLY_IF clause in MYSQL_ADD_PLUGIN and the requirement
that every plugin's CMakeLists.txt *must* do MYSQL_ADD_PLUGIN
for PLUGIN_XXX=YES to work. This was very fragile and cannot be
relied on.

Use a different implementation of =YES check - iterate all
PLUGIN_* variables and see which one doesn't have a matching target.

Revert all ONLY_IF changes in CMakeLists.txt files.
2015-02-15 22:14:33 +01:00
Sergei Golubchik
8e80f91fa3 Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42 2015-02-11 23:50:40 +01:00