OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 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 # This is a small script for manually launching valgrind, along with passing | 7 # This is a small script for manually launching valgrind, along with passing |
8 # it the suppression file, and some helpful arguments (automatically attaching | 8 # it the suppression file, and some helpful arguments (automatically attaching |
9 # the debugger on failures, etc). Run it from your repo root, something like: | 9 # the debugger on failures, etc). Run it from your repo root, something like: |
10 # $ sh ./tools/valgrind/valgrind.sh ./out/Debug/chrome | 10 # $ sh ./tools/valgrind/valgrind.sh ./out/Debug/chrome |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 echo "Using valgrind binaries from ${CHROME_VALGRIND}" | 84 echo "Using valgrind binaries from ${CHROME_VALGRIND}" |
85 | 85 |
86 set -x | 86 set -x |
87 PATH="${CHROME_VALGRIND}/bin:$PATH" | 87 PATH="${CHROME_VALGRIND}/bin:$PATH" |
88 # We need to set these variables to override default lib paths hard-coded into | 88 # We need to set these variables to override default lib paths hard-coded into |
89 # Valgrind binary. | 89 # Valgrind binary. |
90 export VALGRIND_LIB="$CHROME_VALGRIND/lib/valgrind" | 90 export VALGRIND_LIB="$CHROME_VALGRIND/lib/valgrind" |
91 export VALGRIND_LIB_INNER="$CHROME_VALGRIND/lib/valgrind" | 91 export VALGRIND_LIB_INNER="$CHROME_VALGRIND/lib/valgrind" |
92 | 92 |
93 # G_SLICE=always-malloc: make glib use system malloc | 93 # G_SLICE=always-malloc: make glib use system malloc |
| 94 # NSS_DISABLE_UNLOAD=1: make nss skip dlclosing dynamically loaded modules, |
| 95 # which would result in "obj:*" in backtraces. |
94 # NSS_DISABLE_ARENA_FREE_LIST=1: make nss use system malloc | 96 # NSS_DISABLE_ARENA_FREE_LIST=1: make nss use system malloc |
95 # G_DEBUG=fatal_warnings: make GTK abort on any critical or warning assertions. | 97 # G_DEBUG=fatal_warnings: make GTK abort on any critical or warning assertions. |
96 # If it crashes on you in the Options menu, you hit bug 19751, | 98 # If it crashes on you in the Options menu, you hit bug 19751, |
97 # comment out the G_DEBUG=fatal_warnings line. | 99 # comment out the G_DEBUG=fatal_warnings line. |
98 # | 100 # |
99 # GTEST_DEATH_TEST_USE_FORK=1: make gtest death tests valgrind-friendly | 101 # GTEST_DEATH_TEST_USE_FORK=1: make gtest death tests valgrind-friendly |
100 # | 102 # |
101 # When everyone has the latest valgrind, we might want to add | 103 # When everyone has the latest valgrind, we might want to add |
102 # --show-possibly-lost=no | 104 # --show-possibly-lost=no |
103 # to ignore possible but not definite leaks. | 105 # to ignore possible but not definite leaks. |
104 | 106 |
105 G_SLICE=always-malloc \ | 107 G_SLICE=always-malloc \ |
| 108 NSS_DISABLE_UNLOAD=1 \ |
106 NSS_DISABLE_ARENA_FREE_LIST=1 \ | 109 NSS_DISABLE_ARENA_FREE_LIST=1 \ |
107 G_DEBUG=fatal_warnings \ | 110 G_DEBUG=fatal_warnings \ |
108 GTEST_DEATH_TEST_USE_FORK=1 \ | 111 GTEST_DEATH_TEST_USE_FORK=1 \ |
109 $RUN_COMMAND \ | 112 $RUN_COMMAND \ |
110 --trace-children=yes \ | 113 --trace-children=yes \ |
111 --suppressions="$SUPPRESSIONS" \ | 114 --suppressions="$SUPPRESSIONS" \ |
112 "${DEFAULT_TOOL_FLAGS[@]}" \ | 115 "${DEFAULT_TOOL_FLAGS[@]}" \ |
113 "$@" | 116 "$@" |
OLD | NEW |