Repository navigation
cmake: add a memcheck option for ctest - #56157
NitzanMordhai wants to merge 2 commits into
Conversation
ff88d60 to
b2a5ee0
Compare
rzarzynski
left a comment
There was a problem hiding this comment.
I very, very like this idea! I hope that ultimately every make check run will happen under valgrind.
I understand there will be a transition period in which we cannot enable (merge) the memcheck because of existing, hidden bugs. This is the main reason behind not approving this immediately.
There was a problem hiding this comment.
nit: not sure we need to repeat the --suppression here as MEMORYCHECK_SUPPRESSION_FILE is defined below.
There was a problem hiding this comment.
changed and also added some more parameters
b2a5ee0 to
a5d98ea
Compare
f2b371b to
2888c2a
Compare
There was a problem hiding this comment.
shall we include this module only if WITH_TESTS is enabled?
There was a problem hiding this comment.
also, we might want to wire BUILD_TESTING with WITH_TESTS.
There was a problem hiding this comment.
@tchaikov can you please clarify what BUILD_TESTING means? i couldn't find it
There was a problem hiding this comment.
There was a problem hiding this comment.
i'd suggest put these settings into a dedicated file under cmake, something like cmake/CTestScript.cmake, which contains:
include(CTest)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS
"--trace-children=no --leak-check=full --soname-synonyms=somalloc=*tcmalloc* \
--child-silent-after-fork=yes")
set(MEMORYCHECK_SUPPRESSIONS_FILE
"${CMAKE_SOURCE_DIR}/qa/valgrind.supp")
i would prefer just running the tests with ASan, and run them with valgrind with a daily cron job. but yeah, if we have the |
a4acff4 to
74a2a91
Compare
Adding the option to run the ctest with valgring so we will be able to find un-initialized variables. To run the unit-test with memory check: ctest -R name_test -T memcheck -j 80 Signed-off-by: Nitzan Mordechai <[email protected]>
74a2a91 to
5d1753e
Compare
i'd love to see asan/ubsan enabled for make check. i've always had trouble getting ceph to start up cleanly with asan enabled though, so i imagine this would be a large project running under valgrind is a lot slower, especially during startup, so i'd like to see how much longer the checks take when it's enabled. it's important that we have timely feedback on PRs, so i wouldn't want valgrind to add hours to the runtime |
| @@ -0,0 +1,8 @@ | |||
| function(build_tests) | |||
There was a problem hiding this comment.
sorry for the confusion. i think we can either put the body of this function into this file as it is. and let user to call it like
ctest -S cmake/CTestScript.cmake ...or just include this file at the top-level CMakeLists.txt. again, i still think it might be better to keep include(CTest) in this file.
| if(WITH_TESTS) | ||
| add_dependencies(tests neorados) | ||
| endif() |
There was a problem hiding this comment.
this change can be submitted in another PR.
| add_subdirectory(selinux) | ||
| endif(WITH_SELINUX) | ||
|
|
||
| if(WITH_TESTS) |
There was a problem hiding this comment.
this change does not belong to this PR.
i am surprised to learn this actually. does this also apply to our unit tests? or just the servers ? AFAICT, crimson should already be using ASan, as seastar uses ASan when it is built in Debug mode.
yup, i share the same concern with you. |
499f2a1 to
ab2b984
Compare
There was a problem hiding this comment.
not sure how far you get, but i ran into a link failure in #56241
ab2b984 to
f985a87
Compare
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
Adding the option to run the ctest with valgring so we will be able to find un-initialized variables.
To run the unit-test with memory check:
ctest -R name_test -T memcheck -j 80
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e