Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: tools/valgrind/asan/asan_symbolize.py

Issue 2823563003: asan symbolize: Restore invalid utf-8 ignorance. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 from third_party import asan_symbolize 7 from third_party import asan_symbolize
8 8
9 import argparse 9 import argparse
10 import base64 10 import base64
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 original_snippet = base64.b64decode(test_run['output_snippet_base64']) 177 original_snippet = base64.b64decode(test_run['output_snippet_base64'])
178 symbolized_snippet = self.symbolize_snippet(original_snippet) 178 symbolized_snippet = self.symbolize_snippet(original_snippet)
179 if symbolized_snippet == original_snippet: 179 if symbolized_snippet == original_snippet:
180 # No sanitizer reports in snippet. 180 # No sanitizer reports in snippet.
181 return 181 return
182 182
183 test_run['original_output_snippet'] = test_run['output_snippet'] 183 test_run['original_output_snippet'] = test_run['output_snippet']
184 test_run['original_output_snippet_base64'] = \ 184 test_run['original_output_snippet_base64'] = \
185 test_run['output_snippet_base64'] 185 test_run['output_snippet_base64']
186 186
187 test_run['output_snippet'] = symbolized_snippet 187 test_run['output_snippet'] = symbolized_snippet.decode('utf-8', 'replace')
188 test_run['output_snippet_base64'] = \ 188 test_run['output_snippet_base64'] = \
189 base64.b64encode(symbolized_snippet) 189 base64.b64encode(symbolized_snippet)
190 test_run['snippet_processed_by'] = 'asan_symbolize.py' 190 test_run['snippet_processed_by'] = 'asan_symbolize.py'
191 191
192 192
193 def symbolize_snippets_in_json(filename, symbolization_loop): 193 def symbolize_snippets_in_json(filename, symbolization_loop):
194 with open(filename, 'r') as f: 194 with open(filename, 'r') as f:
195 json_data = json.load(f) 195 json_data = json.load(f)
196 196
197 test_run_symbolizer = JSONTestRunSymbolizer(symbolization_loop) 197 test_run_symbolizer = JSONTestRunSymbolizer(symbolization_loop)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 if args.test_summary_json_file: 237 if args.test_summary_json_file:
238 symbolize_snippets_in_json(args.test_summary_json_file, loop) 238 symbolize_snippets_in_json(args.test_summary_json_file, loop)
239 else: 239 else:
240 # Process stdin. 240 # Process stdin.
241 asan_symbolize.logfile = sys.stdin 241 asan_symbolize.logfile = sys.stdin
242 loop.process_logfile() 242 loop.process_logfile()
243 243
244 if __name__ == '__main__': 244 if __name__ == '__main__':
245 main() 245 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698