Commit dde4cbb0 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Remove valgrind support

Bug: v8:6566
Change-Id: If48fea99f2b1c8069dd20075bf4d9a6c6282bb7c
Reviewed-on: https://chromium-review.googlesource.com/708757Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48439}
parent 1bc14b83
......@@ -46,7 +46,6 @@
'../tools/gcmole/run_gcmole.gyp:*',
'../tools/jsfunfuzz/jsfunfuzz.gyp:*',
'../tools/run-deopt-fuzzer.gyp:*',
'../tools/run-valgrind.gyp:*',
],
}],
]
......
......@@ -62,9 +62,9 @@
'V8 Linux - noi18n - debug': 'gn_debug_x86_no_i18n',
'V8 Linux - verify csa': 'gn_release_x86_verify_csa',
# Linux64.
'V8 Linux64 - builder': 'gn_release_x64_valgrind',
'V8 Linux64 - builder': 'gn_release_x64',
'V8 Linux64 - concurrent marking - builder': 'gn_release_x64_concurrent_marking',
'V8 Linux64 - debug builder': 'gn_debug_x64_valgrind',
'V8 Linux64 - debug builder': 'gn_debug_x64',
'V8 Linux64 - custom snapshot - debug builder': 'gn_debug_x64_custom',
'V8 Linux64 - internal snapshot': 'gn_release_x64_internal',
'V8 Linux64 - gyp': 'gyp_release_x64',
......@@ -198,7 +198,7 @@
'v8_linux_gcc_compile_rel': 'gn_release_x86_gcc_minimal_symbols',
'v8_linux_gcc_rel': 'gn_release_x86_gcc_minimal_symbols',
'v8_linux64_gcc_compile_dbg': 'gn_debug_x64_gcc',
'v8_linux64_rel_ng': 'gn_release_x64_valgrind_trybot',
'v8_linux64_rel_ng': 'gn_release_x64_trybot',
'v8_linux64_verify_csa_rel_ng': 'gn_release_x64_verify_csa',
'v8_linux64_gyp_rel_ng': 'gyp_release_x64',
'v8_linux64_avx2_rel_ng': 'gn_release_x64_trybot',
......@@ -433,12 +433,6 @@
'gn', 'release_bot', 'x64', 'edge', 'ubsan_vptr_recover', 'swarming'],
'gn_release_x64_ubsan_vptr_minimal_symbols': [
'gn', 'release_bot', 'x64', 'ubsan_vptr', 'minimal_symbols', 'swarming'],
'gn_release_x64_valgrind': [
'gn', 'release_bot', 'x64', 'swarming', 'valgrind',
'no_custom_libcxx'],
'gn_release_x64_valgrind_trybot': [
'gn', 'release_trybot', 'x64', 'swarming', 'valgrind',
'no_custom_libcxx'],
'gn_release_x64_verify_csa': [
'gn', 'release_bot', 'x64', 'swarming', 'dcheck_always_on',
'v8_enable_slow_dchecks', 'v8_verify_csa'],
......@@ -461,9 +455,6 @@
'gn', 'debug_bot', 'x64', 'minimal_symbols', 'swarming'],
'gn_debug_x64_trybot': [
'gn', 'debug_trybot', 'x64', 'swarming'],
'gn_debug_x64_valgrind': [
'gn', 'debug_bot', 'x64', 'swarming', 'valgrind',
'no_custom_libcxx'],
# GN debug configs for x86.
'gn_debug_x86': [
......@@ -775,11 +766,6 @@
'gn_args': 'is_ubsan_vptr=true is_ubsan_no_recover=false',
},
'valgrind': {
'gn_args': 'v8_has_valgrind=true',
'gyp_defines': 'has_valgrind=1',
},
'v8_no_i18n': {
'gn_args': 'v8_enable_i18n_support=false icu_use_data_file=false',
'gyp_defines': 'v8_enable_i18n_support=0 icu_use_data_file_flag=0',
......
......@@ -13,7 +13,6 @@ group("gn_all") {
":jsfunfuzz_run",
":run-deopt-fuzzer_run",
":run-gcmole_run",
":run-valgrind_run",
]
}
}
......@@ -49,11 +48,3 @@ v8_isolate_run("run-gcmole") {
isolate = "gcmole/run-gcmole.isolate"
}
v8_isolate_run("run-valgrind") {
deps = [
"..:d8_run",
]
isolate = "run-valgrind.isolate"
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'conditions': [
['test_isolation_mode != "noop"', {
'targets': [
{
'target_name': 'run_valgrind_run',
'type': 'none',
'dependencies': [
'../src/d8.gyp:d8_run',
],
'includes': [
'../gypfiles/features.gypi',
'../gypfiles/isolate.gypi',
],
'sources': [
'run-valgrind.isolate',
],
},
],
}],
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'command': [
'run-valgrind.py',
],
'files': [
'run-valgrind.py',
],
},
'conditions': [
['has_valgrind==1', {
'variables': {
'files': [
# This assumes vagrind binaries have been fetched as a custom deps
# into v8/third_party/valgrind. It is not clear on which target
# machine this will run, but grabbing both is cheap.
'../third_party/valgrind/linux_x86/',
'../third_party/valgrind/linux_x64/',
],
},
}],
],
'includes': [
'../src/d8.isolate',
],
}
#!/usr/bin/env python
#
# Copyright 2009 the V8 project 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.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# 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.
# Simple wrapper for running valgrind and checking the output on
# stderr for memory leaks.
# Uses valgrind from third_party/valgrind. Assumes the executable is passed
# with a path relative to the v8 root.
from os import path
import platform
import re
import subprocess
import sys
V8_ROOT = path.dirname(path.dirname(path.abspath(__file__)))
MACHINE = 'linux_x64' if platform.machine() == 'x86_64' else 'linux_x86'
VALGRIND_ROOT = path.join(V8_ROOT, 'third_party', 'valgrind', MACHINE)
VALGRIND_BIN = path.join(VALGRIND_ROOT, 'bin', 'valgrind')
VALGRIND_LIB = path.join(VALGRIND_ROOT, 'lib', 'valgrind')
VALGRIND_ARGUMENTS = [
VALGRIND_BIN,
'--error-exitcode=1',
'--leak-check=full',
'--smc-check=all',
]
if len(sys.argv) < 2:
print 'Please provide an executable to analyze.'
sys.exit(1)
executable = path.join(V8_ROOT, sys.argv[1])
if not path.exists(executable):
print 'Cannot find the file specified: %s' % executable
sys.exit(1)
# Compute the command line.
command = VALGRIND_ARGUMENTS + [executable] + sys.argv[2:]
# Run valgrind.
process = subprocess.Popen(
command,
stderr=subprocess.PIPE,
env={'VALGRIND_LIB': VALGRIND_LIB}
)
code = process.wait();
errors = process.stderr.readlines();
# If valgrind produced an error, we report that to the user.
if code != 0:
sys.stderr.writelines(errors)
sys.exit(code)
# Look through the leak details and make sure that we don't
# have any definitely, indirectly, and possibly lost bytes.
LEAK_RE = r"(?:definitely|indirectly|possibly) lost: "
LEAK_LINE_MATCHER = re.compile(LEAK_RE)
LEAK_OKAY_MATCHER = re.compile(r"lost: 0 bytes in 0 blocks")
leaks = []
for line in errors:
if LEAK_LINE_MATCHER.search(line):
leaks.append(line)
if not LEAK_OKAY_MATCHER.search(line):
sys.stderr.writelines(errors)
sys.exit(1)
# Make sure we found between 2 and 3 leak lines.
if len(leaks) < 2 or len(leaks) > 3:
sys.stderr.writelines(errors)
sys.stderr.write('\n\n#### Malformed valgrind output.\n#### Exiting.\n')
sys.exit(1)
# No leaks found.
sys.stderr.writelines(errors)
sys.exit(0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment