-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
I think we need to disable lua for asan in this constellation then. |
@markus2330 just the test or the whole lua binding? |
If the plugin crashes it makes sense to remove it completely (in this situation with ASAN). We already have code to exclude plugins for ASAN builds, e.g. for yamlcpp. @sanssecours Why does the lua plugin disable tests for "APPLE AND ENABLE_ASAN"? Does the plugin generally work with ASAN and only the tests fail? |
As far as I remember because the tests do not work when ASAN is enabled (AddressSanitizer is loaded too late).
Seems the bindings work fine. At least
. |
I am still not sure how you want me to proceed here. |
We should run ASAN with clang and gcc in the Jenkinsfile. If there are errors, we disable the respective plugin (in the constellation where it causes problem), document the reduced test coverage in doc/todo/TESTING (or if there is a good chance that someone fixes it by GitHub Issue). The lua problems are unlikely to be fixed soon, as currently nobody seems to need this plugin. |
Did you look at the list of failing tests?
If we disable all those constellations we might as well not run it as all. |
No sorry, I did not have time to look at it. But nearly everything seems to be related to swig (haskell, python, ruby) and glib. We can also disable all swig/glib bindings for this ASAN build. The other parts are actively maintained:
If we continue to not run it (or run it with errors which means the build is ignored) the code will degrade even more. If we check for what works now, we at least do not get regressions. As long as there is no upstream support of ASAN builds for our dependencies (and it seems to be lacking for quite some libs and languages) it is unrealistic that everything works with ASAN. This is not something that can be fixed within our source. But we as library should enable other applications to be ASAN and valgrind clean. So we need to be pioneers in this area. |
I am pretty certain that you misspelled @tom-wa here. By the way: It is also possible that |
Concerning The test fails on my machine, if I enable the leak sanitizer. I can fix the problem by not requiring the |
Thank you for looking into it!
Okay, then this test needs to be excluded, too 😉 Luckily INI is not the default.
Sounds good. Alternatively you could try one of the other code plugins? I am also okay with excluding all these tests for this ASAN build, none of them tests essential or core functionality. |
After this update the test `testshell_markdown_mini` should also complete successfully if we - build Elektra with enabled address sanitizer and - enable the leak sanitizer (via `ASAN_OPTIONS=detect_leaks=1`) . See also: ElektraInitiative#1963
5703d75
to
50bdeb3
Compare
easier said than done. I expected all the dependent stuff to deactivate itself but it seems like it isn't set up correctly. |
Is there no handling of binding dependencies at all? |
The dependency handling needs to be implemented manually in CMake. Seems like it was forgotten in the (unfortunately unmaintained) gsettings. Please implement it or at least open separate bug reports.
A very short time ago it was not even easily possible to query which binding is included. It was a lot of work done recently by @waht. |
|
||
# compile our c wrapper which takes care of invoking the haskell runtime | ||
# the actual haskell plugin gets linked in dynamically as a library | ||
add_plugin (${target} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_plugin needs to be present at all stages, to disable plugins remove_plugin needs to be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was not the problem
@markus2330 i can not add codeblocks for in code comments so I will answer here in full
As you can see the block needed to be moved up to where all the if blocks are. And that is all that I changed. |
Notification async example needs oi_uv bindings. This binding is not build for ASAN builds. Until proper handling of dependencies in cmake is implemented (ElektraInitiative#2007) we manually disable the example for such builds.
This update fixes memory leaks in the following tests: - `testshell_markdown_base64`, - `testshell_markdown_ini`, and - `testshell_markdown_tcl` .
Since the Markdown Shell Recorder test leaks memory, if we load `binary` instead of `base64` (which provides `binary`), we also rewrite the MSR test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks great.
Some questions and minor things.
@@ -33,6 +33,23 @@ do | |||
;; | |||
esac | |||
|
|||
# The following checks fail on an ASAN enabled build | |||
# See also: https://github.com/ElektraInitiative/libelektra/pull/1963 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please document in doc/todo/TESTING
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 90a6608
src/plugins/tcl/README.md
Outdated
@@ -2,7 +2,7 @@ | |||
- infos/author = Markus Raab <elektra@libelektra.org> | |||
- infos/licence = BSD | |||
- infos/provides = storage/tcl | |||
- infos/needs = code null binary | |||
- infos/needs = ccode null base64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as already said, it would be better if we can use generic providers here (like binary) and fix the tutorials to use concrete plugins (that pass ASAN checks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to solve this in a different PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use generic providers here (like binary) and fix the tutorials to use concrete plugins
I do not think that will work here, since these plugins are listed under infos/needs
and not under infos/recommends
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you explicitly state needed plugins, kdb mount will know that the dependency is already fulfilled.
src/plugins/ini/README.md
Outdated
@@ -146,7 +146,7 @@ By default the INI plugin does not support binary data. You can use the [Base64 | |||
|
|||
```sh | |||
# Mount INI and recommended plugin Base64 | |||
sudo kdb mount --with-recommends config.ini user/examples/ini ini | |||
sudo kdb mount config.ini user/examples/ini ini base64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't --with-recommends together with base64 also do the right thing? And we should document that base64 is added to pass ASAN tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't --with-recommends together with base64 also do the right thing?
While this works, using --with-recommends
is redundant and might also be confusing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thus we should explain that "base64" is only there to make ASAN happy.
@@ -6,6 +6,11 @@ if (NOT SWIG_FOUND) | |||
return () | |||
endif () | |||
|
|||
if (ENABLE_ASAN) | |||
exclude_binding (swig "SWIG is not compatible with ENABLE_ASAN") | |||
return () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this return be problematic once we change the bindings to behave like the plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't expect so
if (NOT GOBJECT_FOUND) | ||
exclude_binding (glib "No gobject found using pkg-config, also remove gi bindings because they depend on it") | ||
else () | ||
add_binding (glib) | ||
return () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below. Furthermore the diff is hard to read because of this reformatting.
@@ -52,6 +52,10 @@ function (add_plugintest testname) | |||
"Trying to add plugintest ${testname} but no such plugin was added (try to use LINK_PLUGIN)" | |||
) | |||
endif () | |||
|
|||
# plugin for test was not added in previous phase or removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this also relevant for the docu above?
@@ -215,6 +215,78 @@ macro (add_haskell_plugin target) | |||
"${GHC_GMP_PATH}" | |||
"${CMAKE_INSTALL_RPATH}" | |||
"${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/elektra/haskell") | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@e1528532 Can you take a look?
This certainly needs a restructuring.
@@ -147,6 +148,7 @@ These notes are of interest for people developing Elektra: | |||
- A build job checks if PRs modify the release notes. *(Markus Raab)* | |||
- <<TODO>> | |||
- <<TODO>> | |||
- Ported GCC ASAN build job to new build system *(René Schwaiger + Lukas Winkler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed a * here :(
anything else @markus2330? |
jenkins build all please |
Thank you, looks good! I am not sure if the kdb mount itself leaks memory or later commands but I think the added lines should be clear anyway.
You can simply add "ready to merge" if you finished the reviews and all build jobs finished successfully. (Or additionally ping me if I do not respond). Btw. if you have changes beyond Jenkinsfile, please do not forget to call "jenkins build all please". |
Thank you for your great work! |
Purpose
Enables a docker ASAN build to replace the current one
Checklist
closes #2006
closes #2007