diff options
author | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-22 20:18:26 +0000 |
---|---|---|
committer | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-22 20:18:26 +0000 |
commit | 6814d5d2b3d86247e010286bd3c218722f93881c (patch) | |
tree | 8417caa975ea0b9d373c0b2d1e79d97d16733926 | |
parent | 71a1426dea83fad4fd6e5c3fd938dec01da450d0 (diff) | |
download | chromium_src-6814d5d2b3d86247e010286bd3c218722f93881c.zip chromium_src-6814d5d2b3d86247e010286bd3c218722f93881c.tar.gz chromium_src-6814d5d2b3d86247e010286bd3c218722f93881c.tar.bz2 |
Increase valgrind's redzone from 16 to 64 bytes.
If https://bugs.kde.org/show_bug.cgi?id=208197 is ever fixed,
we can get rid of the patch and change the redzone size
with a commandline option instead.
Install to /usr/local/valgrind-10880-redzone to make it easier to tell which machines have the updated valgrind.
Add DIRNAME variable to valgrind build script to simplify changing name of tarball/build dir/install dir.
Also give -f option to mv because macosx's mv is timid about overwriting symlinks.
Review URL: http://codereview.chromium.org/216048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26849 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | tools/valgrind/build-valgrind-for-chromium.sh | 29 | ||||
-rwxr-xr-x | tools/valgrind/chrome_tests.sh | 2 | ||||
-rw-r--r-- | tools/valgrind/redzone.patch | 13 |
3 files changed, 32 insertions, 12 deletions
diff --git a/tools/valgrind/build-valgrind-for-chromium.sh b/tools/valgrind/build-valgrind-for-chromium.sh index 726cd10..62047c0 100755 --- a/tools/valgrind/build-valgrind-for-chromium.sh +++ b/tools/valgrind/build-valgrind-for-chromium.sh @@ -18,6 +18,11 @@ VEX_SVN_REV=1914 # and TSAN may be out of sync, so you have to check that out by rev anyway TSAN_SVN_REV=1129 +# suffix for build and install dir to denote our set of patches (may be empty) +PATCHLEVEL=-redzone + +DIRNAME=valgrind-${VALGRIND_SVN_REV}${PATCHLEVEL} + THISDIR=$(dirname "${0}") THISDIR=$(cd "${THISDIR}" && /bin/pwd) @@ -27,8 +32,7 @@ x|x/*) ;; echo "Usage: sh build-valgrind-for-chromium.sh [prefix]" echo "Prefix is optional, but if present, must be the absolute path to where" echo "you want to install valgrind's bin, include, and lib directories." - echo "Prefix defaults to /usr/local/valgrind-${VALGRIND_SVN_REV}, where" - echo "${VALGRIND_SVN_REV} is the revision used when retrieving valgrind from svn." + echo "Prefix defaults to /usr/local/$DIRNAME." echo "Will use sudo to do the install if you don't own the parent of prefix." exit 1 ;; @@ -44,15 +48,15 @@ then fi # Clean checkout our untar -rm -rf "valgrind-${VALGRIND_SVN_REV}" -mkdir -p "valgrind-${VALGRIND_SVN_REV}" +test -d "$DIRNAME" && rm -rf ./"$DIRNAME" +mkdir -p "$DIRNAME" if test "x${USE_TARBALL}" != "xyes" then # Check out latest version that following patches known to apply against - svn co -r "${VALGRIND_SVN_REV}" "svn://svn.valgrind.org/valgrind/trunk" "valgrind-${VALGRIND_SVN_REV}" + svn co -r "${VALGRIND_SVN_REV}" "svn://svn.valgrind.org/valgrind/trunk" "$DIRNAME" - cd "valgrind-${VALGRIND_SVN_REV}" + cd "$DIRNAME" # Make sure svn gets the right version of the external VEX repo, too svn update -r "${VEX_SVN_REV}" VEX/ @@ -69,6 +73,9 @@ then # "Need library load address in log files" patch -p0 < "${THISDIR}/xml-loadadr.patch" + # Make red zone 64 bytes bigger to catch more buffer overruns + patch -p0 < "${THISDIR}/redzone.patch" + if [ "${INSTALL_TSAN}" = "yes" ] then # Add ThreadSanitier to the installation. @@ -85,7 +92,7 @@ then then # replace symlink with actual contents! cp install-sh install-sh.new - mv install-sh.new install-sh + mv -f install-sh.new install-sh chmod +x install-sh fi @@ -101,17 +108,17 @@ fi if test "x${MAKE_TARBALL}" = "xyes" then - tar -czvf "valgrind-${VALGRIND_SVN_REV}.tgz" "valgrind-${VALGRIND_SVN_REV}" + tar -czvf "$DIRNAME".tgz "$DIRNAME" fi if test "x${USE_TARBALL}" = "xyes" then - tar -xzvf "valgrind-${VALGRIND_SVN_REV}.tgz" + tar -xzvf "$DIRNAME".tgz fi if test "x${MAKE_TARBALL}" != "xyes" then - cd "valgrind-${VALGRIND_SVN_REV}" + cd "$DIRNAME" OVERRIDE_LD_DIR="${THISDIR}/override_ld" if ld --version | grep gold @@ -139,7 +146,7 @@ then fi # Desired parent directory for valgrind's bin, include, etc. - PREFIX="${1:-/usr/local/valgrind-${VALGRIND_SVN_REV}}" + PREFIX="${1:-/usr/local/$DIRNAME}" parent_of_prefix=$(dirname "${PREFIX}") if test ! -d "${parent_of_prefix}" then diff --git a/tools/valgrind/chrome_tests.sh b/tools/valgrind/chrome_tests.sh index cea7777..3371fcd 100755 --- a/tools/valgrind/chrome_tests.sh +++ b/tools/valgrind/chrome_tests.sh @@ -12,7 +12,7 @@ if test x"$CHROME_VALGRIND_BIN" = x then # Figure out which valgrind is installed. Use most recent one. # See build-valgrind-for-chromium.sh and its history for these constants. - for SVNREV in '10880' '10771' '{2009-07-15}' + for SVNREV in '10880-redzone' '10880' '10771' '{2009-07-15}' do SHORTSVNREV=`echo $SVNREV | tr -d '{\-}'` CHROME_VALGRIND_BIN=/usr/local/valgrind-$SHORTSVNREV/bin diff --git a/tools/valgrind/redzone.patch b/tools/valgrind/redzone.patch new file mode 100644 index 0000000..22f0bf7 --- /dev/null +++ b/tools/valgrind/redzone.patch @@ -0,0 +1,13 @@ +Index: memcheck/mc_include.h +=================================================================== +--- memcheck/mc_include.h (revision 10888) ++++ memcheck/mc_include.h (working copy) +@@ -43,7 +43,7 @@ + /*------------------------------------------------------------*/ + + /* We want at least a 16B redzone on client heap blocks for Memcheck */ +-#define MC_MALLOC_REDZONE_SZB 16 ++#define MC_MALLOC_REDZONE_SZB 64 + + /* For malloc()/new/new[] vs. free()/delete/delete[] mismatch checking. */ + typedef |