-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add Sanitizers (UBSAN/ASAN) #1085
Conversation
469c0b0
to
8626359
Compare
Could you please explain how to use these, as a user? I can make use of the normal testsuite by typing edit: I just noticed that you triggered a bug in gcc-8.3.0, is there an open bug for it? |
See above: Enable with -DRTTR_ENABLE_SANITIZERS=ON, then I recommend a recent clang for that. I haven't found a bug report although it's easy to reproduce |
So the way how this works seems to be: Executing the tests is actually really fast, given the complexity of the project. |
Almost: The test must be fast as they are meant to be run very often during developing. Read about Test Driven Development (TDD) which would be the ideal. The current tests don't cover the whole project though, see the badges in the readme: We are currently at ~57% of the main project (which excludes all submodules) |
I intended to run this with user priviliges, but I'm lacking of the correct git vodoo to checkout your sanitizers branch correctly. this is from the package manager, run by the root user:
|
Generic workflow (replace
Edit: On the errors:
|
Could you tell me which boost bug that is? If I knew it I could try to patch it locally? |
okay, so via this config: and with running as a user, the That network error might be the bug that stops me from opening a new game on the rip2, you remember? :-) I backported the fix to v1.65, will be right back with the results. |
Alright, when executing as a normal user and with the boost fix backported, it's all set, only #1090 remains. |
b0480ab
to
50bf2e5
Compare
Workaround buggy GCC in previous distros: https://stackoverflow.com/q/50024731/1930508
Don't use capture-less lambda with auto* param decaying into a function pointer
g++ doesn't seem to work on CI (segfault on caca_free_display)
On CI initialization errors and SDL_mixer seems to leak a lot then...
@Flow86 Ready to merge |
I noticed that you added some commits to this branch wich likely fix #1089 and gave it a go on arm with this config:
but this compile fails during linking:
However, this gets triggered by the sanitizer function |
This is a known bug in Clang. See android/ndk#184, https://bugs.llvm.org/buglist.cgi?quicksearch=__mulodi4, https://bugs.llvm.org/show_bug.cgi?id=17693 CI found a visibility issue though. Fix incoming. |
That commit 376bc85 isn't related to these |
No. As the message says it comes from |
I'm sorry, but that doesn't work with make. Once there is an error, the job server halts. But you might stub out the responsible test and attach the patch seperatly in your next posting - however, you must decide how much of additional work that is going to be for you. |
No. You can use -i or -k to continue on error. See make --help |
hmm, okay, I'll checkout tomorrow how to convince the package manager of that :-) |
there you go: build-arm-sanitizers.log.zip I count 50 errors, where 40 of them are |
Alright then officially: Bug in Clang, go to their sources and try to fix it if you must, otherwise just run the sanitizers on non-special systems where it works or don't run them at all. It's mostly for CI. |
Not to annoy you, but can we go ahead? :-) |
I can't merge this without an approving review by e.g. @Flow86 |
Undefined behavior and memory violation can cause hard to find bugs. Those sanitizers make this easier as they can be run with the code and tests.
It adds the potential for adding fuzzers (fuzzy testing) via
-fsanitize=fuzzing
for Clang to find even more problems.Solution for now:
-DRTTR_ENABLE_SANITIZERS=ON
Other changes: