From 51721db54d4b7401ff4d93ca0af25ced9ba82f73 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Thu, 12 Mar 2009 17:28:52 +0000 Subject: Add a script to more easily run valgrind with our parameters and suppressions. Add some more suppressions to the suppressions file. I don't have any errors when running Chromium on my workstation. Review URL: http://codereview.chromium.org/43129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11546 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/valgrind/suppressions.txt | 40 +++++++++++++++++++++++++++++++++++ tools/valgrind/valgrind.sh | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 tools/valgrind/valgrind.sh diff --git a/tools/valgrind/suppressions.txt b/tools/valgrind/suppressions.txt index d142686..33234091 100644 --- a/tools/valgrind/suppressions.txt +++ b/tools/valgrind/suppressions.txt @@ -181,3 +181,43 @@ fun:memcpy fun:init_resb_result } + +{ + libc + Memcheck:Cond + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so +} + +{ + libc + Memcheck:Addr4 + obj:/lib/ld-2.7.so + obj:/lib/ld-2.7.so +} + +{ + FIXME IPCing uninitialized data + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:sendmsg + fun:_ZN3IPC7Channel11ChannelImpl4SendEPNS_7MessageE +} + +{ + SQLite ? + Memcheck:Param + write(buf) + obj:/lib32/libpthread-2.7.so + fun:unixWrite + fun:sqlite3OsWrite + fun:writeJournalHdr +} + +{ + SQLite (when creating a new database) ? + Memcheck:Cond + fun:sqlite3VdbeMemShallowCopy + fun:sqlite3VdbeExec + fun:sqlite3Step +} diff --git a/tools/valgrind/valgrind.sh b/tools/valgrind/valgrind.sh new file mode 100644 index 0000000..d0cff56 --- /dev/null +++ b/tools/valgrind/valgrind.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is a small script for manually launching valgrind, along with passing +# it the suppression file, and some helpful arguments (automatically attaching +# the debugger on failures, etc). Run it from your repo root, something like: +# $ sh ./tools/valgrind/valgrind.sh ./chrome/Hammer/chrome + +set -e + +if [ $# -eq 0 ]; then + echo "usage: " + exit 1 +fi + +# Prefer a 32-bit gdb if it's available. +GDB="/usr/bin/gdb32"; +if [ ! -x $GDB ]; then + GDB="gdb" +fi + +# Prefer a local install of valgrind if it's available. +VALGRIND="/usr/local/bin/valgrind" +if [ ! -x $VALGRIND ]; then + VALGRIND="valgrind" +fi + +SUPPRESSIONS=`pwd`/tools/valgrind/suppressions.txt + +set -v + +# Pass GTK glib allocations through to system malloc so valgrind sees them. +# Overwrite newly allocated or freed objects with 0x41 to catch inproper use. +# smc-check=all is required for valgrind to see v8's dynamic code generation. +# trace-children to follow into the renderer processes. +# Prompt to attach gdb when there was an error detected. +G_SLICE=always-malloc \ +"$VALGRIND" \ + --trace-children=yes \ + --db-command="$GDB -nw %f %p" \ + --db-attach=yes \ + --suppressions="$SUPPRESSIONS" \ + --malloc-fill=41 --free-fill=41 \ + --smc-check=all \ + "$@" -- cgit v1.1