diff --git a/testing/mochitest/leaks.py b/testing/mochitest/leaks.py index 23c12d9bbdc2..11f46f1801ea 100644 --- a/testing/mochitest/leaks.py +++ b/testing/mochitest/leaks.py @@ -232,6 +232,10 @@ class LSANLeaks(object): self.logger.warning( "TEST-UNEXPECTED-FAIL | LeakSanitizer | LeakSanitizer has encountered a fatal error.") + if self.foundFrames: + self.logger.info("TEST-INFO | LeakSanitizer | To show the addresses of leaked objects add report_objects=1 to LSAN_OPTIONS") + self.logger.info("TEST-INFO | LeakSanitizer | This can be done in testing/mozbase/mozrunner/mozrunner/utils.py") + for f in self.foundFrames: self.logger.warning( "TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at " + f) diff --git a/testing/mozbase/mozrunner/mozrunner/utils.py b/testing/mozbase/mozrunner/mozrunner/utils.py index fd5db0ef8b8f..59462c2bf793 100755 --- a/testing/mozbase/mozrunner/mozrunner/utils.py +++ b/testing/mozbase/mozrunner/mozrunner/utils.py @@ -185,6 +185,8 @@ def test_environment(xrePath, env=None, crashreporter=True, debugger=False, log.info("LSan enabled.") asanOptions.append('detect_leaks=1') lsanOptions = ["exitcode=0"] + # Uncomment out the next line to report the addresses of leaked objects. + #lsanOptions.append("report_objects=1") suppressionsFile = os.path.join( lsanPath, 'lsan_suppressions.txt') if os.path.exists(suppressionsFile):