Skip to content
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

Make CI fail if sanitizers find errors #477

Closed
mknaranja opened this issue Nov 27, 2022 · 1 comment · Fixed by #478
Closed

Make CI fail if sanitizers find errors #477

mknaranja opened this issue Nov 27, 2022 · 1 comment · Fixed by #478
Labels
class::bug Bugs found in the software loc::backend This issue concerns the C++ backend implementation. loc::continuous integration This issue concerns any problem of continuous integration.

Comments

@mknaranja
Copy link
Member

If address or undefined behavior sanitizers report errors, we currently break the program

  • for undefined behavior sanitizer: due to fno-sanitize-recover=all
  • for undefined address sanitizer: "If a bug is detected, the program will print an error message to stderr and exit with a non-zero exit code"

See: https://github.com/DLR-SC/memilio/blob/main/cpp/CMakeLists.txt#L55-L56

For documentation of sanitizers see https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html or https://clang.llvm.org/docs/AddressSanitizer.html

However, in these cases, googletest does not recognize a test where the sanitizer recently reported an error

2022-11-25T16:23:33.8702714Z 
2022-11-25T16:23:33.8702950Z [----------] 7 tests from TestSaveParameters
2022-11-25T16:23:33.8703402Z [ RUN      ] TestSaveParameters.json_single_sim_write_read_compare
2022-11-25T16:23:33.9018905Z [       OK ] TestSaveParameters.json_single_sim_write_read_compare (31 ms)
2022-11-25T16:23:33.9019443Z [ RUN      ] TestSaveParameters.json_uncertain_matrix_write_read_compare
2022-11-25T16:23:33.9134622Z /home/runner/work/memilio/memilio/cpp/build/_deps/jsoncpp-src/src/lib_json/json_reader.cpp:1559:39: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself

as failed and gave a green "OK" sign in the github UI.

In order to have correct test reporting, we can take google/googletest#3086

@mknaranja mknaranja added class::bug Bugs found in the software loc::backend This issue concerns the C++ backend implementation. loc::continuous integration This issue concerns any problem of continuous integration. labels Nov 27, 2022
@mknaranja mknaranja moved this to Product Backlog in MEmilio: Agent-Based-Model Nov 27, 2022
@mknaranja mknaranja moved this to Product Backlog in MEmilio: Equation-Based-Models Nov 27, 2022
@mknaranja mknaranja linked a pull request Nov 27, 2022 that will close this issue
17 tasks
@mknaranja mknaranja moved this from Product Backlog to Development in MEmilio: Agent-Based-Model Nov 28, 2022
@mknaranja mknaranja moved this from Product Backlog to 🏗 Development in MEmilio: Equation-Based-Models Nov 28, 2022
@mknaranja
Copy link
Member Author

I just found that the integration is also documented here: https://google.github.io/googletest/advanced.html

Repository owner moved this from 🏗 Development to ✅ Done (Sprint) in MEmilio: Equation-Based-Models Dec 8, 2022
Repository owner moved this from Development to Done (Sprint) in MEmilio: Agent-Based-Model Dec 8, 2022
@HenrZu HenrZu moved this from ✅ Done (Sprint) to Done (Total) in MEmilio: Equation-Based-Models Dec 12, 2022
@DavidKerkmann DavidKerkmann moved this from Done (Sprint) to Done (Total) in MEmilio: Agent-Based-Model Dec 20, 2022
@xsaschako xsaschako moved this from EPIC to Done (Total) in MEmilio: Agent-Based-Model Development Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class::bug Bugs found in the software loc::backend This issue concerns the C++ backend implementation. loc::continuous integration This issue concerns any problem of continuous integration.
Projects
Status: Done (Total) 💯
Development

Successfully merging a pull request may close this issue.

1 participant