-
Notifications
You must be signed in to change notification settings - Fork 123
Fix sanitizer issues #788
Comments
Should we open separate bugs per found undefined behavior or just add them here? |
I am not sure if it is useful to list them at all. There are quite many and its easy to trigger them. But you can add them here. |
This one in the used nickel library seems to have quite some in and one in the |
I updated the issue to use |
Since the ASAN build jobs do not build all plugins, here are some other tests that currently also fail on my machine after I enable the address sanitizer:
. |
The error messages would be interesting. If lua/java cause the problems we might have to exclude the tests (at least for the version/OS where it does not work). I get now a segmentation fault I had not earlier (only with ASAN):
Unfortunately, no core dump gets generated, even though they are activated. Have to investigate it later. |
Below are logs of the individual tests. Hope they are helpful.
It looks like the Lua tests fail cause the address sanitizer is not loaded correctly:
. |
Yes, I have the same impression. And for Java it seems like libelektra is not
found at all, do the tests work without ASAN?
Disabling these tests for ASAN&&APPLE could be an option?
|
Yes.
Do these tests work on Linux with enabled ASAN? Anyway, as long as I do not need any functionality of the Java or Lua bindings, disabling these tests if address sanitization is enabled is fine with me. |
René Schwaiger wrote:
Yes.
Strange, seems like we have to dig more into details what ASAN does. Why would
it cause to not find libraries?
For me now it yields some crashes when `LD_LIBRARY_PATH` is set (without any
useful stack trace). It might also be related to not finding some libs (at
runtime).
Also the build process failed because of the segfaults, I needed to manually
invoke:
```
build-64/src/include> ../../bin//elektra-export-errors
/home/markus/Projekte/Elektra/current/src/error/specification
/home/markus/Projekte/Elektra/build/src/include/kdberrors.h
build-64/src/libs/elektra> ../../../bin//elektra-export-symbols
resolver_fm_hpu_b dump augeas base64 blockresolver boolean c cachefilter ccode
conditionals constants counter crypto_botan crypto_gcrypt crypto_openssl
csvstorage curlget date dbus desktop doc dpkg dump enum error fcrypt file
filecheck fstab glob hexcode hidden hosts iconv ini iterate jni journald
keytometa line lineendings list logchange lua mathcheck mini mozprefs
multifile network ni noresolver null passwd path profile python python2 range
regexstore rename required resolver_fm_b_b resolver_fm_hb_b resolver_fm_hp_b
resolver_fm_hpu_b resolver_fm_pb_b resolver_fm_ub_x resolver_fm_uhb_xb
resolver_fm_xb_x resolver_fm_xhp_x resolver_fm_xp_x semlock shell simpleini
simplespeclang spec struct sync syslog tcl template timeofday tracer type
uname validation wresolver xerces xmltool yajl yaml
```
This problem was not here earlier, but its hard to find out which change
causes this problem.
> Disabling these tests for ASAN&&APPLE could be an option?
Do these tests work on Linux with enabled ASAN? Anyway, as long as I do not
need any functionality of the Java or Lua bindings, disabling these tests
if address sanitization is enabled is fine with me.
At least lua worked for me (with ASAN):
```
Start 38: test_keyset.lua
38/172 Test #38: test_keyset.lua ......................... Passed 0.01
sec
Start 39: test_kdb.lua
39/172 Test #39: test_kdb.lua ............................ Passed 0.12
sec
Start 40: test_key.lua
40/172 Test #40: test_key.lua ............................ Passed 0.01
sec
```
Maven seems to also not work with Linux (ASAN):
```
Start 32: testjna_maven
32/174 Test #32: testjna_maven ...........................***Failed 1.73
sec
…-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.libelektra.KeySetTest
==503==Shadow memory range interleaves with an existing memory mapping. ASan
cannot proceed correctly. ABORTING.
```
So I would say you can disable the maven/java/jni tests with ASAN on any
system and lua only for Mac OS X?
Other tests fail though because of these segfault issues (mainly shell
recorder tests). But this seems to be a completely different problem, maybe
ASAN is not installed correctly on my system?
|
Sounds good to me. I included commits that disable the tests in pull request #1548. |
Hello newcomer
Since 702cd0c one can easily enable undefinied behavior sanitizer.
Simply use clang as toolchain and use debug/asan (e.g. by adding
-DENABLE_DEBUG=ON -DENABLE_ASAN=ON -DCMAKE_C_COMPILER=clang-3.8 -DCMAKE_CXX_COMPILER=clang++-3.8
to your cmake invocation). It might work for gcc, too.Then try to run all tests (see tree.libelektra.org/doc/TESTING.md) and fix some issues that are reported. Do not try to fix all at once, but create a PR as early as possible.
See also:
https://build.libelektra.org/jenkins/job/elektra-clang-asan/lastFailedBuild/console
https://build.libelektra.org/jenkins/job/elektra-gcc-asan/lastFailedBuild/console
The text was updated successfully, but these errors were encountered: