On travis CI where I use clang version 3.4 (tags/RELEASE_34/final)
which is already installed, I build my code with this:
clang++ main.cpp -m64 -fsanitize=undefined -Werror -std=c++98 -pedantic -pedantic-errors -fvisibility=hidden -fstrict-aliasing -Weverything -Qunused-arguments -fcolor-diagnostics -O3 -DNDEBUG
(this command is obtained from compile_commands.json
which is generated from cmake)
And in the output after the program quits some numbers (like hex representation of memory) appear:
00 00 00 10 70 fb 01 00 00 00 00 10 70 fb 01
My guess is this is from the UB sanitizer because when I build with ASAN or no sanitizer at all these numbers aren't there.
So what do they mean? How do I diagnose my UB error (if this is indeed such)?
I thought when a sanitizer encounters an error it crashes the program and prints a big message with explanation. So what is this?
This is a deal breaker for me because I compare reference output in a text file with the output of the program from the current build and such additional output breaks everything.
I tried locally using Clang 3.6, which is the default for my Ubuntu using the same build command, but when I run the executable I get no errors or such additional output.
here is the failing build on travis - and I don't think my code is relevant because my problem is with the sanitizer output not being helpful at all.