Package: valgrind
Version: 1:3.6.1-2
Severity: important
Tags: patch
With no VALGRIND_OPTS set, valgrind is completely broken:
$ valgrind ls
valgrind: Bad option: -suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
valgrind: Use --help for more information or consult the user manual.
The problem is that the valgrind wrapper script sets:
VALGRIND_OPTS="$VALGRIND_OPTS --suppressions=..."
resulting in
VALGRIND_OPTS=" --suppressions=..."
but the options parser chokes on the leading space. The bug seems to be
introduced by patch 0004, which mismatches the start of the string and
the start of where we write useful values. Patch is attached.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.38-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages valgrind depends on:
ii libc6 2.13-4 Embedded GNU C Library: Shared lib
pn libc6-dbg <none> (no description available)
Versions of packages valgrind recommends:
ii gdb 7.2-1 The GNU Debugger
Versions of packages valgrind suggests:
pn alleyoop <none> (no description available)
pn kcachegrind <none> (no description available)
pn valkyrie <none> (no description available)
-- no debconf information
diff --git a/coregrind/m_commandline.c b/coregrind/m_commandline.c
index 265232a..c86ac67 100644
--- a/coregrind/m_commandline.c
+++ b/coregrind/m_commandline.c
@@ -99,13 +99,12 @@ static void add_args_from_string ( HChar* s )
int quoted = '\0';
vg_assert(cp);
while (True) {
- HChar* out = cp;
+ HChar* out = tmp = cp;
// We have alternating sequences: blanks, non-blanks, blanks...
// copy the non-blanks sequences, and add terminating '\0'
// deal with " or '-quoted strings properly.
while (VG_(isspace)(*cp)) cp++;
if (*cp == 0) break;
- tmp = cp;
while ( (quoted || !VG_(isspace)(*cp)) && *cp) {
if (*cp == quoted) {
quoted = '\0';