[MDEV-11708] cmake -DWITH_ASAN no longer works Created: 2017-01-03 Updated: 2017-02-15 Resolved: 2017-02-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.2.0 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | valgrind | ||
| Environment: |
GNU/Linux |
||
| Sprint: | 10.2.4-1, 10.2.4-2 |
| Description |
|
The cmake option -DWITH_ASAN does not work in MariaDB Server 10.2. In 10.1 it does work, and it can catch a class of bugs that is not noticed by Valgrind, such as Currently, an attempt to configure 10.2 -DWITH_ASAN results in a message that incorrectly claims that we do not know how to enable ASAN. The patch below fixes that:
Alas, with this patch, the linking of libmariadb will fail due to unresolved references to ASAN symbols, presumably because the above compiler flags are not being used when linking (possible also when compiling) libmariadb. Note: I think that the sanitizer flags must be set differently for debug and release. I do not want -Wno-error or -O1 for release builds, because release builds typically specify 'stronger' flags (such as -Werror -O3). I guess we want -O1 in debug builds, so that ASAN will not slow down things too much. I think that the -Wno-error is optional (probably needed because the internal continuous integration system at Oracle is actually testing code with ASAN, and some debug code could generate warnings). |
| Comments |
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||
|
It still does not work for me:
The build fails with linking errors like this:
| ||||
| Comment by Marko Mäkelä [ 2017-01-31 ] | ||||
|
Clarification: -DWITH_ASAN in 10.2 does work with GCC 6.3.0, but not with clang 4.0.0. |