⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98758 in webkit


Ignore:
Timestamp:
Oct 28, 2011, 1:46:29 PM (15 years ago)
Author:
eric@webkit.org
Message:

NRWT crashes when parsing leaks output due to UTF-8 decoding error
https://bugs.webkit.org/show_bug.cgi?id=71112

Reviewed by Adam Barth.

Use read_binary_file instead of read_text_file and add a test
case with some non-utf8 data to make sure we don't break this in the future.

  • Scripts/webkitpy/layout_tests/port/leakdetector.py:
  • Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r98753 r98758  
     12011-10-28  Eric Seidel  <eric@webkit.org>
     2
     3        NRWT crashes when parsing leaks output due to UTF-8 decoding error
     4        https://bugs.webkit.org/show_bug.cgi?id=71112
     5
     6        Reviewed by Adam Barth.
     7
     8        Use read_binary_file instead of read_text_file and add a test
     9        case with some non-utf8 data to make sure we don't break this in the future.
     10
     11        * Scripts/webkitpy/layout_tests/port/leakdetector.py:
     12        * Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py:
     13
    1142011-10-28  David Levin  <levin@chromium.org>
    215
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py

    r98682 r98758  
    121121        total_leaks = 0
    122122        for leak_file_path in leak_file_paths:
    123             leaks_output = self._filesystem.read_text_file(leak_file_path)
     123            # Leaks have been seen to include non-utf8 data, so we use read_binary_file.
     124            # See https://bugs.webkit.org/show_bug.cgi?id=71112.
     125            leaks_output = self._filesystem.read_binary_file(leak_file_path)
    124126            count, _, _ = self._parse_leaks_output(leaks_output)
    125127            total_leaks += count
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py

    r98639 r98758  
    110110        detector = self._make_detector()
    111111        detector._filesystem = MockFileSystem({
    112             '/mock-results/DumpRenderTree-1234-leaks.txt': 'Process 1234: 12 leaks for 40 total leaked bytes.\n',
     112            # The \xff is some non-utf8 characters to make sure we don't blow up trying to parse the file.
     113            '/mock-results/DumpRenderTree-1234-leaks.txt': '\xff\nProcess 1234: 12 leaks for 40 total leaked bytes.\n\xff\n',
    113114            '/mock-results/DumpRenderTree-23423-leaks.txt': 'Process 1235: 12341 leaks for 27934 total leaked bytes.\n',
    114115            '/mock-results/DumpRenderTree-823-leaks.txt': 'Process 12356: 23412 leaks for 18 total leaked bytes.\n',
Note: See TracChangeset for help on using the changeset viewer.