-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Execute tests with clang sanitizers #394
Comments
See https://travis-ci.org/nlohmann/json/jobs/183684093 for a failing build.
For some reason, the code does not compile with sanitizers switched on, see https://travis-ci.org/nlohmann/json/jobs/183684093. |
Hi, I think I found out why it didn't compile (I had the same problem on my Ubuntu 14.04) by adding : It compiled but seems it didn't run the tests, I will try to work on it and give you a PR, but since it my first time here, I need to find out how. |
I was able to make it compile and run on travis-ci |
Thanks @Daniel599, I shall try this in a feature branch. |
@Daniel599 I can no reproduce your observation: https://travis-ci.org/nlohmann/json/jobs/186632504#L5756 The test case that triggers the undefined behavior is a bit weird anyway. It is an allocator which can be configured to throw a |
@nlohmann I have been thinking about it some more, and I think that something here is odd; Please note that there is another run-time error in unit-algorithms (but seems to be only with clang's libc++) . but considering my first lines of this comment, I`m still not sure that's the right way. |
No worries. Anything that helps us execute the tests with sanitizers is good 😄 |
the build on travis is done: Still no idea how your clang build works, would like to look into that later, side note:
I don't think it's big deal since all your uses are with constant a mount of bytes and their size matches, |
@nlohmann Hi |
Issue #389 could have been prevented if the UB sanitizer had been used during continuous integration. We shall add a Travis job for this if possible.
Required flags:
The text was updated successfully, but these errors were encountered: