summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 15:06:22 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 15:06:22 +0000
commitafcb5ab4ed9707f422abb83b472506ad360aaeaa (patch)
tree5347321339c2aefc787db702c1b989618d094ddc /tools
parent6db29a78fd7d88cdf81e6037313d0cca499bacaf (diff)
downloadchromium_src-afcb5ab4ed9707f422abb83b472506ad360aaeaa.zip
chromium_src-afcb5ab4ed9707f422abb83b472506ad360aaeaa.tar.gz
chromium_src-afcb5ab4ed9707f422abb83b472506ad360aaeaa.tar.bz2
Print out TSan internal assertions as errors
Review URL: http://codereview.chromium.org/6820032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/valgrind/tsan_analyze.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/valgrind/tsan_analyze.py b/tools/valgrind/tsan_analyze.py
index c14346c..30f058a 100644
--- a/tools/valgrind/tsan_analyze.py
+++ b/tools/valgrind/tsan_analyze.py
@@ -57,6 +57,7 @@ class TsanAnalyzer(object):
"|accessing an invalid lock"
"|which did not acquire this lock")
RACE_VERIFIER_LINE = "Confirmed a race|unexpected race"
+ TSAN_ASSERTION = "Assertion failed: "
def __init__(self, source_dir, use_gdb=False):
'''Reads in a set of files.
@@ -96,6 +97,13 @@ class TsanAnalyzer(object):
result.append(self.stack_trace_line_)
return result
+ def ReadTillTheEnd(self):
+ result = [self.line_]
+ while self.line_:
+ self.ReadLine()
+ result.append(self.line_)
+ return result
+
def ParseReportFile(self, filename):
'''Parses a report file and returns a list of ThreadSanitizer reports.
@@ -111,7 +119,7 @@ class TsanAnalyzer(object):
while True:
# Read ThreadSanitizer reports.
self.ReadLine()
- if (self.line_ == ''):
+ if not self.line_:
break
tmp = []
@@ -128,6 +136,10 @@ class TsanAnalyzer(object):
not common.IsWindows()): # workaround for http://crbug.com/53198
tmp.extend(self.ReadSection())
ret.append(tmp)
+ if re.search(TsanAnalyzer.TSAN_ASSERTION, self.line_):
+ tmp.extend(self.ReadTillTheEnd())
+ ret.append(tmp)
+ break
match = re.search(" used_suppression:\s+([0-9]+)\s(.*)", self.line_)
if match:
@@ -185,7 +197,7 @@ class TsanAnalyzer(object):
sys.stdout.flush()
retcode = 0
- if len(reports) > 0:
+ if reports:
logging.error("FAIL! Found %i report(s)" % len(reports))
for report in reports:
logging.error('\n' + report)
@@ -210,7 +222,7 @@ if __name__ == '__main__':
"(used to normalize source paths in baseline)")
(options, args) = parser.parse_args()
- if len(args) == 0:
+ if not args:
parser.error("no filename specified")
filenames = args