You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2019/10/21 10:24:36 UTC

[GitHub] [qpid-dispatch] jdanekrh commented on a change in pull request #595: DISPATCH-1450: enable thread sanitizer (TSAN) run time checking

jdanekrh commented on a change in pull request #595: DISPATCH-1450: enable thread sanitizer (TSAN) run time checking
URL: https://github.com/apache/qpid-dispatch/pull/595#discussion_r336940927
 
 

 ##########
 File path: README
 ##########
 @@ -100,10 +100,62 @@ This does the following:
 - Run system tests on the installation in 'install'.
 
 
-Using Valgrind
-==============
+Run Time Validation
+===================
 
-If valgrind is installed and cmake option 'USE_VALGRIND' is 'ON' the tests will
-be run with valgrind's memcheck debugger. You can set other types of test runner
-or modify the valgrind flags by setting the TEST_RUNNER cmake variable.
+The CTest test suite can be configured to enable extra run time
+validation checks against the dispatch router.
 
+Since run time validation slows down qdrouter considerably it is
+disabled by default.  It can be enabled by setting the RUNTIME_CHECK
+build flag via the cmake command.
+
+Note well: Depending on your environment the ctest suite may time out
+if validation is enabled due to the additional run time overhead it
+adds.  You can extend the default test time via the ctest "--timeout"
+option.  Example:
+
+ctest --timeout 1500 -VV
+
+The Qpid Dispatch Router test suite supports the following run time
+validation tools:
+
+Valgrind Memcheck
+-----------------
+Runs qdrouterd under Valgrind's memcheck leak checker during the CTest
+suite.  This will cause tests to fail if a memory error is
+encountered.  Use the grinder tool (in the bin directory) to create a
+summary of the errors found during the test run.
+
+The valgrind toolset must be installed in order to use memcheck.
+
+To enable memcheck set the RUNTIME_CHECK build flag to "memcheck":
+
+cmake .. -DRUNTIME_CHECK=memcheck
+
+If valgrind detects errors the qdrouterd process will exit with an
+exit code of 42. This will be displayed in the CTest output. For
+example:
+
+RuntimeError: Errors during teardown:
+Process XXXX error: exit code 42, expected 0
+
+GCC/Clang Thread Sanitizer (TSAN)
+---------------------------------
+This option turns on extra run time threading verification.
+
+Applicable only to GCC versions >= 4.8 and Clang versions >= 4.1.
+
+To enable the thread sanitizer set the RUNTIME_CHECK build flag to "tsan":
+
+cmake .. -DRUNTIME_CHECK=tsan
 
 Review comment:
   It is recommended to use `-g`, and `-O1` or `-O2` with sanitizers (besides `-fno-omit-frame-pointer`, etc), precisely for the reason of speeding up the check. One of the reasons sanitizers can be faster than valgrind.
   
   I am not sure how to do this in CMake. Just throw in `-O1` with other sanitizer options, if current build type is Debug? Note in readme? Require Release (ReleaseWithxxxSymbols) as build type when sanitizers are to be enabled?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org