Skip to content

Commit 49b6ae4

Browse files
committed
[GTK] Fix missing UTF-8 decoding in test crash logs
https://bugs.webkit.org/show_bug.cgi?id=229760 Reviewed by Philippe Normand. Fix a couple of decoding issues in linux_get_crash_log.py, where bytestrings were being printed without decoding. An addditional decoding issue was fixed by Philippe Normand in driver.py when printing ASan results. * Scripts/webkitpy/port/driver.py: (Driver._read_block): * Scripts/webkitpy/port/linux_get_crash_log.py: (GDBCrashLogGenerator._get_trace_from_flatpak): (GDBCrashLogGenerator.generate_crash_log): Canonical link: https://commits.webkit.org/241181@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 008eb05 commit 49b6ae4

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

Tools/ChangeLog

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2021-09-01 Alicia Boya García <aboya@igalia.com>
2+
3+
[GTK] Fix missing UTF-8 decoding in test crash logs
4+
https://bugs.webkit.org/show_bug.cgi?id=229760
5+
6+
Reviewed by Philippe Normand.
7+
8+
Fix a couple of decoding issues in linux_get_crash_log.py, where
9+
bytestrings were being printed without decoding.
10+
11+
An addditional decoding issue was fixed by Philippe Normand in
12+
driver.py when printing ASan results.
13+
14+
* Scripts/webkitpy/port/driver.py:
15+
(Driver._read_block):
16+
* Scripts/webkitpy/port/linux_get_crash_log.py:
17+
(GDBCrashLogGenerator._get_trace_from_flatpak):
18+
(GDBCrashLogGenerator.generate_crash_log):
19+
120
2021-08-31 Chris Dumez <cdumez@apple.com>
221

322
Enable SharedArrayBuffer support when COOP/COEP headers are used

Tools/Scripts/webkitpy/port/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ def _read_block(self, deadline, test_name, wait_for_stderr_eof=False):
732732
break
733733
elif self._check_for_address_sanitizer_violation(err_line):
734734
asan_violation_detected = True
735-
self._crash_report_from_driver = b''
735+
self._crash_report_from_driver = ''
736736
# ASan report starts with a nondescript line, we only detect the second line.
737737
end_of_previous_error_line = self.error_from_test.rfind('\n', 0, -1)
738738
if end_of_previous_error_line > 0:

Tools/Scripts/webkitpy/port/linux_get_crash_log.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def _get_trace_from_flatpak(self):
121121

122122
proc = self._executive.popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
123123
crash_log, stderr = proc.communicate()
124-
errors = string_utils.decode(str(stderr or '<empty>'), errors='ignore').splitlines()
124+
crash_log = string_utils.decode(crash_log, errors='ignore')
125+
errors = string_utils.decode(stderr or '<empty>', errors='ignore').splitlines()
125126
return crash_log, errors
126127

127128
def generate_crash_log(self, stdout, stderr):
@@ -156,7 +157,7 @@ def match_filename(filesystem, directory, filename):
156157
elif coredumpctl:
157158
crash_log, errors = self._get_trace_from_systemd(coredumpctl, pid_representation)
158159

159-
stderr_lines = errors + string_utils.decode(str(stderr or '<empty>'), errors='ignore').splitlines()
160+
stderr_lines = errors + string_utils.decode(stderr or '<empty>', errors='ignore').splitlines()
160161
errors_str = '\n'.join(('STDERR: ' + stderr_line) for stderr_line in stderr_lines)
161162
cppfilt_proc = self._executive.popen(
162163
['c++filt'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)