-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For discussion: Introduce sanitizer options and run with sanitizer on Linux/MacOS #78
base: master
Are you sure you want to change the base?
Conversation
Clang has excellent sanitizers, that are very well supported under MacOS and Linux. Add AddressSanitizer, LeakSanitizer and UndefinedBehaviourSanitizer configure options. Introduce GH action to run the tests with and without sanitizers.
Also, I had to disable FORTIFY_SOURCE as that is known to mess with the Sanitizer. This obviously should also be only done using automake magic if the sanitizer is requested. |
The action output from this change can be seen under |
I like this idea in theory, but personally I would really like for the GH Actions piece to be done separate from the *SAN CI introduction work. FWIW, I don't know why our Cirrus CI integration isn't working for this project. I have lowered privileges in this repo and the others, so I can't confirm/opt-in to whatever infrastructure is needed on the Cirrus CI or GitHub Actions side of things to enable these changes. PS I really want to get away from the autotools-based build system we inherited with these projects. There are a few hacks/some complexity kicking around the ATF/kyua/lutok source base that deal with libtool, and some of the scripts under |
This was just a draft to get discussion started. Yes, I agree that the improvements need to be put into separate PRs, but they only show off in this draft when put together. This work uses GH actions. There is nothing that needs to be set-up, once you have a 1/ 2/ As detailed above, there are changes needed in |
Clang has excellent sanitizers, that are very well supported under MacOS and Linux. Add AddressSanitizer, LeakSanitizer and UndefinedBehaviourSanitizer configure options.
Introduce GH action to run the tests with and without sanitizers.
After #77 I have suppressed the leaks during the
pkg
builds. I thought I would introduce the sanitizers and a corresponding CI run also here.The patch got bigger than I hoped it would be and has some issues I would like to discuss here:
The sanitizers affect both compiler flags as well as ldflags, they need to be passed down to the pkg-config script, otherwise an instrumented atf cannot be linked against by a compliant user looking at pkg-config.
I have abandoned
automake
>20y ago, so the hack that I have put in place should be re-done by somebody actually knowing automake.Questions:
automake
stuff and clean it up.I case of interest I can continue supporting this until it produces reasonable output (atf report showing the leaks, bailing out with test failure), but I will not be able to go into fixing all the leaks.