<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161512] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161512">161512</a></dd>
<dt>Author</dt> <dd>brian.holt@samsung.com</dd>
<dt>Date</dt> <dd>2014-01-08 10:30:12 -0800 (Wed, 08 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK] Parse Valgrind xml leak files
https://bugs.webkit.org/show_bug.cgi?id=119446
Reviewed by Alejandro G. Castro.
Parse the xml files generated by Valgrind to yield useful
information about the memory leaks.
* Scripts/webkitpy/port/gtk.py:
(GtkPort.__init__):
(GtkPort.setup_test_run): Clear the previous output files before new
run.
(GtkPort.print_leaks_summary):
* Scripts/webkitpy/port/leakdetector_valgrind.py: Added.
Parse the xml files generated by Valgrind and summarise leaks
into an easily understandable list.
(get_text_of):
(get_CDATA_of):
(gather_frames):
(ValgrindError):
(ValgrindError.__init__):
(ValgrindError.__str__):
(ValgrindError.unique_string):
(ValgrindError.error_hash):
(ValgrindError.__hash__):
(ValgrindError.__eq__):
(LeakDetectorValgrind):
(LeakDetectorValgrind.__init__):
(LeakDetectorValgrind._parse_leaks_output):
(LeakDetectorValgrind.leaks_files_in_results_directory):
(LeakDetectorValgrind.clean_leaks_files_from_results_directory):
(LeakDetectorValgrind.parse_and_print_leaks_detail):
* Scripts/webkitpy/port/leakdetector_valgrind_unittest.py: Added.
(make_mock_valgrind_output):
(make_mock_incomplete_valgrind_output):
(make_mock_valgrind_results):
(make_mock_valgrind_results_incomplete):
(make_mock_valgrind_results_empty):
(make_mock_valgrind_results_misformatted):
(LeakDetectorValgrindTest):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpyportgtkpy">trunk/Tools/Scripts/webkitpy/port/gtk.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsScriptswebkitpyportleakdetector_valgrindpy">trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportleakdetector_valgrind_unittestpy">trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind_unittest.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (161511 => 161512)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-01-08 18:29:27 UTC (rev 161511)
+++ trunk/Tools/ChangeLog        2014-01-08 18:30:12 UTC (rev 161512)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2014-01-08 Brian Holt <brian.holt@samsung.com>
+
+ [GTK] Parse Valgrind xml leak files
+ https://bugs.webkit.org/show_bug.cgi?id=119446
+
+ Reviewed by Alejandro G. Castro.
+
+ Parse the xml files generated by Valgrind to yield useful
+ information about the memory leaks.
+
+ * Scripts/webkitpy/port/gtk.py:
+ (GtkPort.__init__):
+ (GtkPort.setup_test_run): Clear the previous output files before new
+ run.
+ (GtkPort.print_leaks_summary):
+
+ * Scripts/webkitpy/port/leakdetector_valgrind.py: Added.
+ Parse the xml files generated by Valgrind and summarise leaks
+ into an easily understandable list.
+ (get_text_of):
+ (get_CDATA_of):
+ (gather_frames):
+ (ValgrindError):
+ (ValgrindError.__init__):
+ (ValgrindError.__str__):
+ (ValgrindError.unique_string):
+ (ValgrindError.error_hash):
+ (ValgrindError.__hash__):
+ (ValgrindError.__eq__):
+ (LeakDetectorValgrind):
+ (LeakDetectorValgrind.__init__):
+ (LeakDetectorValgrind._parse_leaks_output):
+ (LeakDetectorValgrind.leaks_files_in_results_directory):
+ (LeakDetectorValgrind.clean_leaks_files_from_results_directory):
+ (LeakDetectorValgrind.parse_and_print_leaks_detail):
+
+ * Scripts/webkitpy/port/leakdetector_valgrind_unittest.py: Added.
+ (make_mock_valgrind_output):
+ (make_mock_incomplete_valgrind_output):
+ (make_mock_valgrind_results):
+ (make_mock_valgrind_results_incomplete):
+ (make_mock_valgrind_results_empty):
+ (make_mock_valgrind_results_misformatted):
+ (LeakDetectorValgrindTest):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
+ (LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):
+
</ins><span class="cx"> 2014-01-08 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r161427.
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportgtkpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (161511 => 161512)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/gtk.py        2014-01-08 18:29:27 UTC (rev 161511)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py        2014-01-08 18:30:12 UTC (rev 161512)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> from webkitpy.port.xvfbdriver import XvfbDriver
</span><span class="cx"> from webkitpy.port.westondriver import WestonDriver
</span><span class="cx"> from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator
</span><ins>+from webkitpy.port.leakdetector_valgrind import LeakDetectorValgrind
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> class GtkPort(Port):
</span><span class="lines">@@ -46,6 +47,7 @@
</span><span class="cx"> def __init__(self, *args, **kwargs):
</span><span class="cx"> super(GtkPort, self).__init__(*args, **kwargs)
</span><span class="cx"> self._pulseaudio_sanitizer = PulseAudioSanitizer()
</span><ins>+ self._leakdetector = LeakDetectorValgrind(self._filesystem, self.results_directory())
</ins><span class="cx">
</span><span class="cx"> if self.get_option("leaks"):
</span><span class="cx"> if not self.get_option("wrapper"):
</span><span class="lines">@@ -81,6 +83,9 @@
</span><span class="cx"> super(GtkPort, self).setup_test_run()
</span><span class="cx"> self._pulseaudio_sanitizer.unload_pulseaudio_module()
</span><span class="cx">
</span><ins>+ if self.get_option("leaks"):
+ self._leakdetector.clean_leaks_files_from_results_directory()
+
</ins><span class="cx"> def clean_up_test_run(self):
</span><span class="cx"> super(GtkPort, self).clean_up_test_run()
</span><span class="cx"> self._pulseaudio_sanitizer.restore_pulseaudio_module()
</span><span class="lines">@@ -159,6 +164,16 @@
</span><span class="cx"> def _port_specific_expectations_files(self):
</span><span class="cx"> return [self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in reversed(self._search_paths())]
</span><span class="cx">
</span><ins>+ def print_leaks_summary(self):
+ if not self.get_option('leaks'):
+ return
+ # FIXME: This is a hack, but we don't have a better way to get this information from the workers yet
+ # because we're in the manager process.
+ leaks_files = self._leakdetector.leaks_files_in_results_directory()
+ if not leaks_files:
+ return
+ self._leakdetector.parse_and_print_leaks_detail(leaks_files)
+
</ins><span class="cx"> # FIXME: We should find a way to share this implmentation with Gtk,
</span><span class="cx"> # or teach run-launcher how to call run-safari and move this down to Port.
</span><span class="cx"> def show_results_html_file(self, results_filename):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportleakdetector_valgrindpy"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind.py (0 => 161512)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind.py         (rev 0)
+++ trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind.py        2014-01-08 18:30:12 UTC (rev 161512)
</span><span class="lines">@@ -0,0 +1,294 @@
</span><ins>+# Copyright (C) 2013 Samsung Electronics. All rights reserved.
+#
+# Based on code from Chromium, copyright as follows:
+#
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from collections import defaultdict
+import hashlib
+import logging
+import re
+import subprocess
+from xml.dom.minidom import parseString
+from xml.parsers.expat import ExpatError
+
+_log = logging.getLogger(__name__)
+
+
+def get_text_of(top_node, name):
+ """ Returns all text in all DOM nodes with a certain |name| that are children of |top_node|. """
+
+ text = ""
+ for nodes_named in top_node.getElementsByTagName(name):
+ text += "".join([node.data for node in nodes_named.childNodes
+ if node.nodeType == node.TEXT_NODE])
+ return text
+
+
+def get_CDATA_of(top_node, name):
+ """ Returns all CDATA in all DOM nodes with a certain |name| that are children of |top_node|. """
+
+ text = ""
+ for nodes_named in top_node.getElementsByTagName(name):
+ text += "".join([node.data for node in nodes_named.childNodes
+ if node.nodeType == node.CDATA_SECTION_NODE])
+ if (text == ""):
+ return None
+ return text
+
+
+# Constants that give real names to the abbreviations in valgrind XML output.
+INSTRUCTION_POINTER = "ip"
+OBJECT_FILE = "obj"
+FUNCTION_NAME = "fn"
+SRC_FILE_DIR = "dir"
+SRC_FILE_NAME = "file"
+SRC_LINE = "line"
+
+
+def gather_frames(node, source_dir):
+ frame_dict = lambda frame: {
+ INSTRUCTION_POINTER: get_text_of(frame, INSTRUCTION_POINTER),
+ OBJECT_FILE: get_text_of(frame, OBJECT_FILE),
+ FUNCTION_NAME: get_text_of(frame, FUNCTION_NAME),
+ SRC_FILE_DIR: get_text_of(frame, SRC_FILE_DIR),
+ SRC_FILE_NAME: get_text_of(frame, SRC_FILE_NAME),
+ SRC_LINE: get_text_of(frame, SRC_LINE)}
+
+ return [frame_dict(frame) for frame in node.getElementsByTagName("frame")]
+
+
+class ValgrindError:
+
+ def __init__(self, source_dir, error_node):
+ self._kind = get_text_of(error_node, "kind")
+ self._backtraces = []
+ self._suppression = None
+ self._additional = []
+
+ # Iterate through the nodes, parsing <what|auxwhat><stack> pairs.
+ description = None
+ for node in error_node.childNodes:
+ if node.localName == "what" or node.localName == "auxwhat":
+ description = "".join([n.data for n in node.childNodes
+ if n.nodeType == n.TEXT_NODE])
+ elif node.localName == "xwhat":
+ description = get_text_of(node, "text")
+ elif node.localName == "stack":
+ assert description
+ self._backtraces.append([description, gather_frames(node, source_dir)])
+ description = None
+ elif node.localName == "origin":
+ description = get_text_of(node, "what")
+ stack = node.getElementsByTagName("stack")[0]
+ frames = gather_frames(stack, source_dir)
+ self._backtraces.append([description, frames])
+ description = None
+ stack = None
+ frames = None
+ elif description and node.localName != None:
+ # The lastest description has no stack, e.g. "Address 0x28 is unknown".
+ self._additional.append(description)
+ description = None
+
+ if node.localName == "suppression":
+ self._suppression = get_CDATA_of(node, "rawtext")
+
+ def __str__(self):
+ output = self._kind + "\n"
+ for backtrace in self._backtraces:
+ output += backtrace[0] + "\n"
+ filter = subprocess.Popen("c++filt -n", stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ shell=True,
+ close_fds=True)
+ buf = ""
+ for frame in backtrace[1]:
+ buf += (frame[FUNCTION_NAME] or frame[INSTRUCTION_POINTER]) + "\n"
+ (stdoutbuf, stderrbuf) = filter.communicate(buf.encode('latin-1'))
+ demangled_names = stdoutbuf.split("\n")
+
+ i = 0
+ for frame in backtrace[1]:
+ output += (" " + demangled_names[i])
+ i = i + 1
+
+ if frame[SRC_FILE_DIR] != "":
+ output += (" (" + frame[SRC_FILE_DIR] + "/" + frame[SRC_FILE_NAME] +
+ ":" + frame[SRC_LINE] + ")")
+ else:
+ output += " (" + frame[OBJECT_FILE] + ")"
+ output += "\n"
+
+ for additional in self._additional:
+ output += additional + "\n"
+
+ assert self._suppression != None, "Your Valgrind doesn't generate " \
+ "suppressions - is it too old?"
+
+ output += "Suppression (error hash=#%016X#):\n" % self.error_hash()
+
+ # Widen the suppressions slightly.
+ supp = self._suppression
+ supp = supp.replace("fun:_Znwj", "fun:_Znw*")
+ supp = supp.replace("fun:_Znwm", "fun:_Znw*")
+ supp = supp.replace("fun:_Znaj", "fun:_Zna*")
+ supp = supp.replace("fun:_Znam", "fun:_Zna*")
+
+ # Split into lines so we can enforce length limits.
+ supplines = supp.split("\n")
+ supp = None # to avoid re-use
+
+ # Truncate at line 26 (VG_MAX_SUPP_CALLERS plus 2 for name and type)
+ # (https://bugs.kde.org/show_bug.cgi?id=199468 proposes raising
+ # VG_MAX_SUPP_CALLERS, but we're probably fine with it as is.)
+ newlen = min(26, len(supplines))
+
+ if (len(supplines) > newlen):
+ supplines = supplines[0:newlen]
+ supplines.append("}")
+
+ for frame in range(len(supplines)):
+ # Replace the always-changing anonymous namespace prefix with "*".
+ m = re.match("( +fun:)_ZN.*_GLOBAL__N_.*\.cc_" +
+ "[0-9a-fA-F]{8}_[0-9a-fA-F]{8}(.*)",
+ supplines[frame])
+ if m:
+ supplines[frame] = "*".join(m.groups())
+
+ return output + "\n".join(supplines) + "\n"
+
+ def unique_string(self):
+ rep = self._kind + " "
+ for backtrace in self._backtraces:
+ for frame in backtrace[1]:
+ rep += frame[FUNCTION_NAME]
+
+ if frame[SRC_FILE_DIR] != "":
+ rep += frame[SRC_FILE_DIR] + "/" + frame[SRC_FILE_NAME]
+ else:
+ rep += frame[OBJECT_FILE]
+ return rep
+
+ def error_hash(self):
+ # This is a device-independent hash identifying the suppression.
+ # By printing out this hash we can find duplicate reports between tests and
+ # different shards running on multiple buildbots
+ return int(hashlib.md5(self.unique_string()).hexdigest()[:16], 16)
+
+ def __hash__(self):
+ return hash(self.unique_string())
+
+ def __eq__(self, rhs):
+ return self.unique_string() == rhs
+
+
+class LeakDetectorValgrind(object):
+
+ def __init__(self, filesystem, source_dir):
+ self._filesystem = filesystem
+ self._source_dir = source_dir
+
+ # Contains the set of unique errors.
+ self._errors = set()
+ # Contains all suppressions used.
+ self._suppressions = defaultdict(int)
+
+ def _parse_leaks_output(self, leaks_output):
+ try:
+ parsed_string = parseString(leaks_output)
+ except ExpatError, e:
+ parse_failed = True
+ _log.error("could not parse %s: %s" % (leaks_output, e))
+ return
+
+ cur_report_errors = set()
+
+ commandline = None
+ preamble = parsed_string.getElementsByTagName("preamble")[0]
+ for node in preamble.getElementsByTagName("line"):
+ if node.localName == "line":
+ for x in node.childNodes:
+ if x.nodeType == node.TEXT_NODE and "Command" in x.data:
+ commandline = x.data
+ break
+
+ raw_errors = parsed_string.getElementsByTagName("error")
+ for raw_error in raw_errors:
+ # Ignore "possible" leaks and InvalidRead/Write by default.
+ if (get_text_of(raw_error, "kind") != "Leak_PossiblyLost") and \
+ (get_text_of(raw_error, "kind") != "Leak_StillReachable") and \
+ (get_text_of(raw_error, "kind") != "InvalidWrite") and \
+ (get_text_of(raw_error, "kind") != "InvalidRead"):
+ error = ValgrindError(self._source_dir, raw_error)
+ if error not in cur_report_errors:
+ # We haven't seen such errors doing this report yet...
+ if error in self._errors:
+ # ... but we saw it in earlier reports, e.g. previous UI test
+ cur_report_errors.add("This error was already printed in "
+ "some other test, see 'hash=#%016X#'" % \
+ error.error_hash())
+ else:
+ # ... and we haven't seen it in other tests as well
+ self._errors.add(error)
+ cur_report_errors.add(error)
+
+ suppcountlist = parsed_string.getElementsByTagName("suppcounts")
+ if len(suppcountlist) > 0:
+ suppcountlist = suppcountlist[0]
+ for node in suppcountlist.getElementsByTagName("pair"):
+ count = get_text_of(node, "count")
+ name = get_text_of(node, "name")
+ self._suppressions[name] += int(count)
+
+ return cur_report_errors
+
+ def leaks_files_in_results_directory(self):
+ return self._filesystem.glob(self._filesystem.join(self._source_dir, "drt-*-leaks.xml"))
+
+ def clean_leaks_files_from_results_directory(self):
+ # Remove old Valgrind xml files before starting this run.
+ leaks_files = self.leaks_files_in_results_directory()
+ for f in leaks_files:
+ self._filesystem.remove(f)
+
+ def parse_and_print_leaks_detail(self, leaks_files):
+ for f in leaks_files:
+ leaks_output = self._filesystem.read_binary_file(f)
+ detected_leaks = self._parse_leaks_output(leaks_output)
+
+ _log.info("-----------------------------------------------------")
+ _log.info("Suppressions used:")
+ _log.info(" count name")
+ for (name, count) in sorted(self._suppressions.items(), key=lambda (k, v): (v, k)):
+ _log.info("%7d %s" % (count, name))
+ _log.info("-----------------------------------------------------")
+
+ if self._errors:
+ _log.info("Valgrind detected %s leaks:" % len(self._errors))
+ for leak in self._errors:
+ _log.info(leak)
</ins></span></pre></div>
<a id="trunkToolsScriptswebkitpyportleakdetector_valgrind_unittestpy"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind_unittest.py (0 => 161512)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind_unittest.py         (rev 0)
+++ trunk/Tools/Scripts/webkitpy/port/leakdetector_valgrind_unittest.py        2014-01-08 18:30:12 UTC (rev 161512)
</span><span class="lines">@@ -0,0 +1,812 @@
</span><ins>+# Copyright (C) 2013 Samsung Electronics. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import unittest2 as unittest
+
+from webkitpy.common.system.filesystem_mock import MockFileSystem
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.port.leakdetector_valgrind import LeakDetectorValgrind
+
+
+def make_mock_valgrind_output(process_name, pid, uuid):
+ return """<?xml version="1.0"?>
+
+<valgrindoutput>
+
+<protocolversion>4</protocolversion>
+<protocoltool>memcheck</protocoltool>
+
+<preamble>
+ <line>Memcheck, a memory error detector</line>
+ <line>Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.</line>
+ <line>Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info</line>
+ <line>Command: /home/user/WebKit/WebKitBuild/Release/Programs/{process_name} -</line>
+</preamble>
+
+<pid>{pid}</pid>
+<ppid>18577</ppid>
+<tool>memcheck</tool>
+
+<args>
+ <vargv>
+ <exe>/usr/bin/valgrind.bin</exe>
+ <arg>--tool=memcheck</arg>
+ <arg>--num-callers=40</arg>
+ <arg>--demangle=no</arg>
+ <arg>--trace-children=no</arg>
+ <arg>--smc-check=all-non-file</arg>
+ <arg>--leak-check=yes</arg>
+ <arg>--leak-resolution=high</arg>
+ <arg>--show-possibly-lost=no</arg>
+ <arg>--show-reachable=no</arg>
+ <arg>--leak-check=full</arg>
+ <arg>--undef-value-errors=no</arg>
+ <arg>--gen-suppressions=all</arg>
+ <arg>--xml=yes</arg>
+ <arg>--xml-file=/home/user/WebKit/WebKitBuild/Release/layout-test-results/drt-{pid}-{uuid}-leaks.xml</arg>
+ <arg>--suppressions=/home/user/WebKit/Tools/Scripts/valgrind/suppressions.txt</arg>
+ <arg>--suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp</arg>
+ </vargv>
+ <argv>
+ <exe>/home/user/WebKit/WebKitBuild/Release/Programs/{process_name}</exe>
+ <arg>-</arg>
+ </argv>
+</args>
+
+<status>
+ <state>RUNNING</state>
+ <time>00:00:00:00.024 </time>
+</status>
+
+
+<status>
+ <state>FINISHED</state>
+ <time>00:00:00:54.186 </time>
+</status>
+
+<error>
+ <unique>0x1a4</unique>
+ <tid>1</tid>
+ <kind>Leak_DefinitelyLost</kind>
+ <xwhat>
+ <text>8 bytes in 1 blocks are definitely lost in loss record 421 of 7,972</text>
+ <leakedbytes>8</leakedbytes>
+ <leakedblocks>1</leakedblocks>
+ </xwhat>
+ <stack>
+ <frame>
+ <ip>0x4C2AF8E</ip>
+ <obj>/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so</obj>
+ <fn>_Znwm</fn>
+ </frame>
+ <frame>
+ <ip>0x6839DEC</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation</fn>
+ </frame>
+ <frame>
+ <ip>0x61E7B03</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>webkit_web_policy_decision_new</fn>
+ </frame>
+ <frame>
+ <ip>0x61CBA6D</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE</fn>
+ </frame>
+ <frame>
+ <ip>0x683DF52</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_</fn>
+ </frame>
+ <frame>
+ <ip>0x6817EFC</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE</fn>
+ </frame>
+ <frame>
+ <ip>0x6818729</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE</fn>
+ </frame>
+ <frame>
+ <ip>0x6818A3A</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE</fn>
+ </frame>
+ <frame>
+ <ip>0x61E3148</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>webkit_web_frame_load_uri</fn>
+ </frame>
+ <frame>
+ <ip>0x44CBC9</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL7runTestRKSs</fn>
+ </frame>
+ <frame>
+ <ip>0x44CED6</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL20runTestingServerLoopv</fn>
+ </frame>
+ <frame>
+ <ip>0x43A2D3</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>main</fn>
+ </frame>
+ </stack>
+ <suppression>
+ <sname>insert_a_suppression_name_here</sname>
+ <skind>Memcheck:Leak</skind>
+ <sframe> <fun>_Znwm</fun> </sframe>
+ <sframe> <fun>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation</fun> </sframe>
+ <sframe> <fun>webkit_web_policy_decision_new</fun> </sframe>
+ <sframe> <fun>_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE</fun> </sframe>
+ <sframe> <fun>webkit_web_frame_load_uri</fun> </sframe>
+ <sframe> <fun>_ZL7runTestRKSs</fun> </sframe>
+ <sframe> <fun>_ZL20runTestingServerLoopv</fun> </sframe>
+ <sframe> <fun>main</fun> </sframe>
+ <rawtext>
+<![CDATA[
+{{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:_Znwm
+ fun:_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation
+ fun:webkit_web_policy_decision_new
+ fun:_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE
+ fun:_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_
+ fun:_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
+ fun:_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
+ fun:_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE
+ fun:webkit_web_frame_load_uri
+ fun:_ZL7runTestRKSs
+ fun:_ZL20runTestingServerLoopv
+ fun:main
+}}
+]]>
+ </rawtext>
+ </suppression>
+</error>
+
+<error>
+ <unique>0x1a5</unique>
+ <tid>1</tid>
+ <kind>Leak_DefinitelyLost</kind>
+ <xwhat>
+ <text>8 bytes in 1 blocks are definitely lost in loss record 422 of 7,972</text>
+ <leakedbytes>8</leakedbytes>
+ <leakedblocks>1</leakedblocks>
+ </xwhat>
+ <stack>
+ <frame>
+ <ip>0x4C2AF8E</ip>
+ <obj>/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so</obj>
+ <fn>_Znwm</fn>
+ </frame>
+ <frame>
+ <ip>0x6839D0C</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker18checkContentPolicyERKNS1_16ResourceResponseEPFvPvNS1_12PolicyActionEES6_EUlS7_E_E10_M_managerERSt9_Any_dataRKSC_St18_Manager_operation</fn>
+ </frame>
+ <frame>
+ <ip>0x61E7B03</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>webkit_web_policy_decision_new</fn>
+ </frame>
+ <frame>
+ <ip>0x61CB527</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN6WebKit17FrameLoaderClient31dispatchDecidePolicyForResponseERKN7WebCore16ResourceResponseERKNS1_15ResourceRequestESt8functionIFvNS1_12PolicyActionEEE</fn>
+ </frame>
+ <frame>
+ <ip>0x6839EC0</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore13PolicyChecker18checkContentPolicyERKNS_16ResourceResponseEPFvPvNS_12PolicyActionEES4_</fn>
+ </frame>
+ <frame>
+ <ip>0x6802F6E</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore14DocumentLoader16responseReceivedEPNS_14CachedResourceERKNS_16ResourceResponseE</fn>
+ </frame>
+ <frame>
+ <ip>0x67E59E0</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore17CachedRawResource16responseReceivedERKNS_16ResourceResponseE</fn>
+ </frame>
+ <frame>
+ <ip>0x684C237</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore17SubresourceLoader18didReceiveResponseERKNS_16ResourceResponseE</fn>
+ </frame>
+ <frame>
+ <ip>0x6F95848</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCoreL19sendRequestCallbackEP8_GObjectP13_GAsyncResultPv</fn>
+ </frame>
+ <frame>
+ <ip>0x8E2D6CA</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libgio-2.0.so.0.3800.0</obj>
+ <fn>g_task_return_now</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/gio</dir>
+ <file>gtask.c</file>
+ <line>1108</line>
+ </frame>
+ <frame>
+ <ip>0x8E2D6E8</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libgio-2.0.so.0.3800.0</obj>
+ <fn>complete_in_idle_cb</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/gio</dir>
+ <file>gtask.c</file>
+ <line>1117</line>
+ </frame>
+ <frame>
+ <ip>0x93A62F4</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0.3800.0</obj>
+ <fn>g_main_context_dispatch</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib</dir>
+ <file>gmain.c</file>
+ <line>3065</line>
+ </frame>
+ <frame>
+ <ip>0x93A6637</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0.3800.0</obj>
+ <fn>g_main_context_iterate.isra.23</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib</dir>
+ <file>gmain.c</file>
+ <line>3712</line>
+ </frame>
+ <frame>
+ <ip>0x93A6A99</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0.3800.0</obj>
+ <fn>g_main_loop_run</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib</dir>
+ <file>gmain.c</file>
+ <line>3906</line>
+ </frame>
+ <frame>
+ <ip>0x8121204</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Dependencies/Root/lib64/libgtk-3.so.0.600.0</obj>
+ <fn>gtk_main</fn>
+ <dir>/home/user/WebKit/WebKitBuild/Dependencies/Source/gtk+-3.6.0/gtk</dir>
+ <file>gtkmain.c</file>
+ <line>1162</line>
+ </frame>
+ <frame>
+ <ip>0x44CBCE</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL7runTestRKSs</fn>
+ </frame>
+ <frame>
+ <ip>0x44CED6</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL20runTestingServerLoopv</fn>
+ </frame>
+ <frame>
+ <ip>0x43A2D3</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>main</fn>
+ </frame>
+ </stack>
+ <suppression>
+ <sname>insert_a_suppression_name_here</sname>
+ <skind>Memcheck:Leak</skind>
+ <sframe> <fun>_Znwm</fun> </sframe>
+ <sframe> <fun>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker18checkContentPolicyERKNS1_16ResourceResponseEPFvPvNS1_12PolicyActionEES6_EUlS7_E_E10_M_managerERSt9_Any_dataRKSC_St18_Manager_operation</fun> </sframe>
+ <sframe> <fun>webkit_web_policy_decision_new</fun> </sframe>
+ <sframe> <fun>_ZN6WebKit17FrameLoaderClient31dispatchDecidePolicyForResponseERKN7WebCore16ResourceResponseERKNS1_15ResourceRequestESt8functionIFvNS1_12PolicyActionEEE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore13PolicyChecker18checkContentPolicyERKNS_16ResourceResponseEPFvPvNS_12PolicyActionEES4_</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore14DocumentLoader16responseReceivedEPNS_14CachedResourceERKNS_16ResourceResponseE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore17CachedRawResource16responseReceivedERKNS_16ResourceResponseE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore17SubresourceLoader18didReceiveResponseERKNS_16ResourceResponseE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCoreL19sendRequestCallbackEP8_GObjectP13_GAsyncResultPv</fun> </sframe>
+ <sframe> <fun>g_task_return_now</fun> </sframe>
+ <sframe> <fun>complete_in_idle_cb</fun> </sframe>
+ <sframe> <fun>g_main_context_dispatch</fun> </sframe>
+ <sframe> <fun>g_main_context_iterate.isra.23</fun> </sframe>
+ <sframe> <fun>g_main_loop_run</fun> </sframe>
+ <sframe> <fun>gtk_main</fun> </sframe>
+ <sframe> <fun>_ZL7runTestRKSs</fun> </sframe>
+ <sframe> <fun>_ZL20runTestingServerLoopv</fun> </sframe>
+ <sframe> <fun>main</fun> </sframe>
+ <rawtext>
+<![CDATA[
+{{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:_Znwm
+ fun:_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker18checkContentPolicyERKNS1_16ResourceResponseEPFvPvNS1_12PolicyActionEES6_EUlS7_E_E10_M_managerERSt9_Any_dataRKSC_St18_Manager_operation
+ fun:webkit_web_policy_decision_new
+ fun:_ZN6WebKit17FrameLoaderClient31dispatchDecidePolicyForResponseERKN7WebCore16ResourceResponseERKNS1_15ResourceRequestESt8functionIFvNS1_12PolicyActionEEE
+ fun:_ZN7WebCore13PolicyChecker18checkContentPolicyERKNS_16ResourceResponseEPFvPvNS_12PolicyActionEES4_
+ fun:_ZN7WebCore14DocumentLoader16responseReceivedEPNS_14CachedResourceERKNS_16ResourceResponseE
+ fun:_ZN7WebCore17CachedRawResource16responseReceivedERKNS_16ResourceResponseE
+ fun:_ZN7WebCore17SubresourceLoader18didReceiveResponseERKNS_16ResourceResponseE
+ fun:_ZN7WebCoreL19sendRequestCallbackEP8_GObjectP13_GAsyncResultPv
+ fun:g_task_return_now
+ fun:complete_in_idle_cb
+ fun:g_main_context_dispatch
+ fun:g_main_context_iterate.isra.23
+ fun:g_main_loop_run
+ fun:gtk_main
+ fun:_ZL7runTestRKSs
+ fun:_ZL20runTestingServerLoopv
+ fun:main
+}}
+]]>
+ </rawtext>
+ </suppression>
+</error>
+
+<error>
+ <unique>0x1a6</unique>
+ <tid>1</tid>
+ <kind>Leak_DefinitelyLost</kind>
+ <xwhat>
+ <text>8 bytes in 1 blocks are definitely lost in loss record 423 of 7,972</text>
+ <leakedbytes>8</leakedbytes>
+ <leakedblocks>1</leakedblocks>
+ </xwhat>
+ <stack>
+ <frame>
+ <ip>0x4C2AF8E</ip>
+ <obj>/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so</obj>
+ <fn>_Znwm</fn>
+ </frame>
+ <frame>
+ <ip>0x6839DEC</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation</fn>
+ </frame>
+ <frame>
+ <ip>0x61E7B03</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>webkit_web_policy_decision_new</fn>
+ </frame>
+ <frame>
+ <ip>0x61CBA6D</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE</fn>
+ </frame>
+ <frame>
+ <ip>0x683DF52</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_</fn>
+ </frame>
+ <frame>
+ <ip>0x6817EFC</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE</fn>
+ </frame>
+ <frame>
+ <ip>0x6818729</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE</fn>
+ </frame>
+ <frame>
+ <ip>0x6818A3A</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE</fn>
+ </frame>
+ <frame>
+ <ip>0x61E3148</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3</obj>
+ <fn>webkit_web_frame_load_uri</fn>
+ </frame>
+ <frame>
+ <ip>0x44CC50</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL7runTestRKSs</fn>
+ </frame>
+ <frame>
+ <ip>0x44CED6</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>_ZL20runTestingServerLoopv</fn>
+ </frame>
+ <frame>
+ <ip>0x43A2D3</ip>
+ <obj>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</obj>
+ <fn>main</fn>
+ </frame>
+ </stack>
+ <suppression>
+ <sname>insert_a_suppression_name_here</sname>
+ <skind>Memcheck:Leak</skind>
+ <sframe> <fun>_Znwm</fun> </sframe>
+ <sframe> <fun>_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation</fun> </sframe>
+ <sframe> <fun>webkit_web_policy_decision_new</fun> </sframe>
+ <sframe> <fun>_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE</fun> </sframe>
+ <sframe> <fun>_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE</fun> </sframe>
+ <sframe> <fun>webkit_web_frame_load_uri</fun> </sframe>
+ <sframe> <fun>_ZL7runTestRKSs</fun> </sframe>
+ <sframe> <fun>_ZL20runTestingServerLoopv</fun> </sframe>
+ <sframe> <fun>main</fun> </sframe>
+ <rawtext>
+<![CDATA[
+{{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:_Znwm
+ fun:_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation
+ fun:webkit_web_policy_decision_new
+ fun:_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE
+ fun:_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_
+ fun:_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
+ fun:_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
+ fun:_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE
+ fun:webkit_web_frame_load_uri
+ fun:_ZL7runTestRKSs
+ fun:_ZL20runTestingServerLoopv
+ fun:main
+}}
+]]>
+ </rawtext>
+ </suppression>
+</error>
+
+<errorcounts>
+</errorcounts>
+
+<suppcounts>
+ <pair>
+ <count>107</count>
+ <name>FcConfigAppFontAddFile (Third Party)</name>
+ </pair>
+ <pair>
+ <count>2098</count>
+ <name>gtk_init_check (Third Party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>g_quark_from_static_string (Third party)</name>
+ </pair>
+ <pair>
+ <count>27</count>
+ <name>FcConfigParseAndLoad (Third Party)</name>
+ </pair>
+ <pair>
+ <count>80</count>
+ <name>webkitAccessibleNew</name>
+ </pair>
+ <pair>
+ <count>177</count>
+ <name>g_thread_proxy (Third Party)</name>
+ </pair>
+ <pair>
+ <count>9</count>
+ <name>FcPatternObjectInsertElt 2 (Third Party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>gtk_window_realize (Third Party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>__nss_database_lookup (Third Party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>cairo_set_source_surface (Third Party)</name>
+ </pair>
+ <pair>
+ <count>2</count>
+ <name>libGL.so (Third party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>g_task_run_in_thread (Third Party)</name>
+ </pair>
+ <pair>
+ <count>2</count>
+ <name>WTF::ThreadIdentifierData::initialize() (Intentional)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>gtk_css_provider_load_from_data (Third Party)</name>
+ </pair>
+ <pair>
+ <count>1</count>
+ <name>libenchant.so new (Third party)</name>
+ </pair>
+</suppcounts>
+
+</valgrindoutput>
+""".format(process_name=process_name, pid=pid, uuid=uuid)
+
+
+def make_mock_incomplete_valgrind_output(process_name, pid, uuid):
+ return """<?xml version="1.0"?>
+
+<valgrindoutput>
+
+<protocolversion>4</protocolversion>
+<protocoltool>memcheck</protocoltool>
+
+<preamble>
+ <line>Memcheck, a memory error detector</line>
+ <line>Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.</line>
+ <line>Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info</line>
+ <line>Command: /home/user/WebKit/WebKitBuild/Release/Programs/{process_name} -</line>
+</preamble>
+
+<pid>{pid}</pid>
+<ppid>18577</ppid>
+<tool>memcheck</tool>
+
+<args>
+ <vargv>
+ <exe>/usr/bin/valgrind.bin</exe>
+ <arg>--tool=memcheck</arg>
+ <arg>--num-callers=40</arg>
+ <arg>--demangle=no</arg>
+ <arg>--trace-children=no</arg>
+ <arg>--smc-check=all-non-file</arg>
+ <arg>--leak-check=yes</arg>
+ <arg>--leak-resolution=high</arg>
+ <arg>--show-possibly-lost=no</arg>
+ <arg>--show-reachable=no</arg>
+ <arg>--leak-check=full</arg>
+ <arg>--undef-value-errors=no</arg>
+ <arg>--gen-suppressions=all</arg>
+ <arg>--xml=yes</arg>
+ <arg>--xml-file=/home/user/WebKit/WebKitBuild/Release/layout-test-results/drt-{pid}-{uuid}-leaks.xml</arg>
+ <arg>--suppressions=/home/user/WebKit/Tools/Scripts/valgrind/suppressions.txt</arg>
+ <arg>--suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp</arg>
+ </vargv>
+ <argv>
+ <exe>/home/user/WebKit/WebKitBuild/Release/Programs/{process_name}</exe>
+ <arg>-</arg>
+ </argv>
+</args>
+
+<status>
+ <state>RUNNING</state>
+ <time>00:00:00:00.024 </time>
+</status>
+""".format(process_name=process_name, pid=pid, uuid=uuid)
+
+
+def make_mock_valgrind_results():
+ return """-----------------------------------------------------
+Suppressions used:
+ count name
+ 2 __nss_database_lookup (Third Party)
+ 2 cairo_set_source_surface (Third Party)
+ 2 g_quark_from_static_string (Third party)
+ 2 g_task_run_in_thread (Third Party)
+ 2 gtk_css_provider_load_from_data (Third Party)
+ 2 gtk_window_realize (Third Party)
+ 2 libenchant.so new (Third party)
+ 4 WTF::ThreadIdentifierData::initialize() (Intentional)
+ 4 libGL.so (Third party)
+ 18 FcPatternObjectInsertElt 2 (Third Party)
+ 54 FcConfigParseAndLoad (Third Party)
+ 160 webkitAccessibleNew
+ 214 FcConfigAppFontAddFile (Third Party)
+ 354 g_thread_proxy (Third Party)
+ 4196 gtk_init_check (Third Party)
+-----------------------------------------------------
+Valgrind detected 2 leaks:
+Leak_DefinitelyLost
+8 bytes in 1 blocks are definitely lost in loss record 421 of 7,972
+ operator new(unsigned long) (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+ std::_Function_base::_Base_manager<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)::{lambda(WebCore::PolicyAction)#1}>::_M_manager(std::_Any_data&, std::_Function_base::_Base_manager<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)::{lambda(WebCore::PolicyAction)#1}> const&, std::_Manager_operation) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ webkit_web_policy_decision_new (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, std::function<void (WebCore::PolicyAction)>) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::FrameLoader::load(WebCore::DocumentLoader*) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::FrameLoader::load(WebCore::FrameLoadRequest const&) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ webkit_web_frame_load_uri (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ runTest(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+ runTestingServerLoop() (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+ main (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+Suppression (error hash=#0449D3ED253FE1F9#):
+
+{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:_Znw*
+ fun:_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS1_15ResourceRequestEPNS1_14DocumentLoaderEN3WTF10PassRefPtrINS1_9FormStateEEEPFvPvS5_SB_bESC_EUlNS1_12PolicyActionEE_E10_M_managerERSt9_Any_dataRKSI_St18_Manager_operation
+ fun:webkit_web_policy_decision_new
+ fun:_ZN6WebKit17FrameLoaderClient39dispatchDecidePolicyForNavigationActionERKN7WebCore16NavigationActionERKNS1_15ResourceRequestEN3WTF10PassRefPtrINS1_9FormStateEEESt8functionIFvNS1_12PolicyActionEEE
+ fun:_ZN7WebCore13PolicyChecker21checkNavigationPolicyERKNS_15ResourceRequestEPNS_14DocumentLoaderEN3WTF10PassRefPtrINS_9FormStateEEEPFvPvS3_S9_bESA_
+ fun:_ZN7WebCore11FrameLoader22loadWithDocumentLoaderEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
+ fun:_ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
+ fun:_ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE
+ fun:webkit_web_frame_load_uri
+ fun:_ZL7runTestRKSs
+ fun:_ZL20runTestingServerLoopv
+ fun:main
+}
+
+
+Leak_DefinitelyLost
+8 bytes in 1 blocks are definitely lost in loss record 422 of 7,972
+ operator new(unsigned long) (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+ std::_Function_base::_Base_manager<WebCore::PolicyChecker::checkContentPolicy(WebCore::ResourceResponse const&, void (*)(void*, WebCore::PolicyAction), void*)::{lambda(WebCore::PolicyAction)#1}>::_M_manager(std::_Any_data&, std::_Function_base::_Base_manager<WebCore::PolicyChecker::checkContentPolicy(WebCore::ResourceResponse const&, void (*)(void*, WebCore::PolicyAction), void*)::{lambda(WebCore::PolicyAction)#1}> const&, std::_Manager_operation) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ webkit_web_policy_decision_new (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebKit::FrameLoaderClient::dispatchDecidePolicyForResponse(WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, std::function<void (WebCore::PolicyAction)>) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::PolicyChecker::checkContentPolicy(WebCore::ResourceResponse const&, void (*)(void*, WebCore::PolicyAction), void*) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::DocumentLoader::responseReceived(WebCore::CachedResource*, WebCore::ResourceResponse const&) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::CachedRawResource::responseReceived(WebCore::ResourceResponse const&) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::SubresourceLoader::didReceiveResponse(WebCore::ResourceResponse const&) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ WebCore::sendRequestCallback(_GObject*, _GAsyncResult*, void*) (/home/user/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.3)
+ g_task_return_now (/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/gio/gtask.c:1108)
+ complete_in_idle_cb (/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/gio/gtask.c:1117)
+ g_main_context_dispatch (/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib/gmain.c:3065)
+ g_main_context_iterate.isra.23 (/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib/gmain.c:3712)
+ g_main_loop_run (/home/user/WebKit/WebKitBuild/Dependencies/Source/glib-2.38.0/glib/gmain.c:3906)
+ gtk_main (/home/user/WebKit/WebKitBuild/Dependencies/Source/gtk+-3.6.0/gtk/gtkmain.c:1162)
+ runTest(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+ runTestingServerLoop() (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+ main (/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
+Suppression (error hash=#8313DEB16B069438#):
+
+{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:_Znw*
+ fun:_ZNSt14_Function_base13_Base_managerIZN7WebCore13PolicyChecker18checkContentPolicyERKNS1_16ResourceResponseEPFvPvNS1_12PolicyActionEES6_EUlS7_E_E10_M_managerERSt9_Any_dataRKSC_St18_Manager_operation
+ fun:webkit_web_policy_decision_new
+ fun:_ZN6WebKit17FrameLoaderClient31dispatchDecidePolicyForResponseERKN7WebCore16ResourceResponseERKNS1_15ResourceRequestESt8functionIFvNS1_12PolicyActionEEE
+ fun:_ZN7WebCore13PolicyChecker18checkContentPolicyERKNS_16ResourceResponseEPFvPvNS_12PolicyActionEES4_
+ fun:_ZN7WebCore14DocumentLoader16responseReceivedEPNS_14CachedResourceERKNS_16ResourceResponseE
+ fun:_ZN7WebCore17CachedRawResource16responseReceivedERKNS_16ResourceResponseE
+ fun:_ZN7WebCore17SubresourceLoader18didReceiveResponseERKNS_16ResourceResponseE
+ fun:_ZN7WebCoreL19sendRequestCallbackEP8_GObjectP13_GAsyncResultPv
+ fun:g_task_return_now
+ fun:complete_in_idle_cb
+ fun:g_main_context_dispatch
+ fun:g_main_context_iterate.isra.23
+ fun:g_main_loop_run
+ fun:gtk_main
+ fun:_ZL7runTestRKSs
+ fun:_ZL20runTestingServerLoopv
+ fun:main
+}
+
+
+"""
+
+
+def make_mock_valgrind_results_incomplete():
+ return """could not parse <?xml version="1.0"?>
+
+<valgrindoutput>
+
+<protocolversion>4</protocolversion>
+<protocoltool>memcheck</protocoltool>
+
+<preamble>
+ <line>Memcheck, a memory error detector</line>
+ <line>Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.</line>
+ <line>Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info</line>
+ <line>Command: /home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree -</line>
+</preamble>
+
+<pid>28531</pid>
+<ppid>18577</ppid>
+<tool>memcheck</tool>
+
+<args>
+ <vargv>
+ <exe>/usr/bin/valgrind.bin</exe>
+ <arg>--tool=memcheck</arg>
+ <arg>--num-callers=40</arg>
+ <arg>--demangle=no</arg>
+ <arg>--trace-children=no</arg>
+ <arg>--smc-check=all-non-file</arg>
+ <arg>--leak-check=yes</arg>
+ <arg>--leak-resolution=high</arg>
+ <arg>--show-possibly-lost=no</arg>
+ <arg>--show-reachable=no</arg>
+ <arg>--leak-check=full</arg>
+ <arg>--undef-value-errors=no</arg>
+ <arg>--gen-suppressions=all</arg>
+ <arg>--xml=yes</arg>
+ <arg>--xml-file=/home/user/WebKit/WebKitBuild/Release/layout-test-results/drt-28531-e8c7d7b83be411e390c9d43d7e01ba08-leaks.xml</arg>
+ <arg>--suppressions=/home/user/WebKit/Tools/Scripts/valgrind/suppressions.txt</arg>
+ <arg>--suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp</arg>
+ </vargv>
+ <argv>
+ <exe>/home/user/WebKit/WebKitBuild/Release/Programs/DumpRenderTree</exe>
+ <arg>-</arg>
+ </argv>
+</args>
+
+<status>
+ <state>RUNNING</state>
+ <time>00:00:00:00.024 </time>
+</status>
+: no element found: line 49, column 0
+-----------------------------------------------------
+Suppressions used:
+ count name
+-----------------------------------------------------
+"""
+
+
+def make_mock_valgrind_results_empty():
+ return """could not parse : no element found: line 1, column 0
+-----------------------------------------------------
+Suppressions used:
+ count name
+-----------------------------------------------------
+"""
+
+
+def make_mock_valgrind_results_misformatted():
+ return """could not parse Junk that should not appear in a valgrind xml file<?xml version="1.0"?: syntax error: line 1, column 0
+-----------------------------------------------------
+Suppressions used:
+ count name
+-----------------------------------------------------
+"""
+
+
+class LeakDetectorValgrindTest(unittest.TestCase):
+
+ def test_parse_and_print_leaks_detail_pass(self):
+ mock_valgrind_output1 = make_mock_valgrind_output('DumpRenderTree', 28529, 'db92e4843be411e3bae1d43d7e01ba08')
+ mock_valgrind_output2 = make_mock_valgrind_output('DumpRenderTree', 28530, 'dd7213423be411e3aa7fd43d7e01ba08')
+ files = {}
+ files['/tmp/layout-test-results/drt-28529-db92e4843be411e3bae1d43d7e01ba08-leaks.xml'] = mock_valgrind_output1
+ files['/tmp/layout-test-results/drt-28530-dd7213423be411e3aa7fd43d7e01ba08-leaks.xml'] = mock_valgrind_output2
+ leakdetector_valgrind = LeakDetectorValgrind(MockFileSystem(files), '/tmp/layout-test-results/')
+
+ OutputCapture().assert_outputs(self, leakdetector_valgrind.parse_and_print_leaks_detail, [files], expected_logs=make_mock_valgrind_results())
+
+ def test_parse_and_print_leaks_detail_incomplete(self):
+ mock_incomplete_valgrind_output = make_mock_incomplete_valgrind_output('DumpRenderTree', 28531, 'e8c7d7b83be411e390c9d43d7e01ba08')
+ files = {}
+ files['/tmp/layout-test-results/drt-28531-e8c7d7b83be411e390c9d43d7e01ba08-leaks.xml'] = mock_incomplete_valgrind_output
+ leakdetector_valgrind = LeakDetectorValgrind(MockFileSystem(files), '/tmp/layout-test-results/')
+
+ OutputCapture().assert_outputs(self, leakdetector_valgrind.parse_and_print_leaks_detail, [files], expected_logs=make_mock_valgrind_results_incomplete())
+
+ def test_parse_and_print_leaks_detail_empty(self):
+ files = {}
+ files['/tmp/Logs/layout-test-results/drt-28532-ebc9a6c63be411e399d4d43d7e01ba08-leaks.xml'] = ""
+ leakdetector_valgrind = LeakDetectorValgrind(MockFileSystem(files), '/tmp/layout-test-results/')
+
+ OutputCapture().assert_outputs(self, leakdetector_valgrind.parse_and_print_leaks_detail, [files], expected_logs=make_mock_valgrind_results_empty())
+
+ def test_parse_and_print_leaks_detail_misformatted(self):
+ self.maxDiff = None
+ misformatted_mock_valgrind_output = 'Junk that should not appear in a valgrind xml file' + make_mock_valgrind_output('DumpRenderTree', 28533, 'fa6d0cd63be411e39c72d43d7e01ba08')[:20]
+ files = {}
+ files['/tmp/layout-test-results/drt-28533-fa6d0cd63be411e39c72d43d7e01ba08-leaks.xml'] = misformatted_mock_valgrind_output
+ leakdetector_valgrind = LeakDetectorValgrind(MockFileSystem(files), '/tmp/layout-test-results/')
+
+ OutputCapture().assert_outputs(self, leakdetector_valgrind.parse_and_print_leaks_detail, [files], expected_logs=make_mock_valgrind_results_misformatted())
</ins></span></pre>
</div>
</div>
</body>
</html>