This fixes #116057, I think. I added a regtest so it won't regress again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5072
// Pretend otherwise.
if (isize == 0) isize = VG_MIN_INSTR_SZB;
- // Check size. XXX: broken for client requests!
- tl_assert(VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB);
+ // Sanity-check size.
+ tl_assert( (VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB)
+ || VG_CLREQ_SZB == isize );
// Get space for and init the inode, record it as the current one.
// Subsequent Dr/Dw/Dm events from the same instruction will
EXTRA_DIST = $(noinst_SCRIPTS) \
chdir.vgtest chdir.stderr.exp \
+ clreq.vgtest clreq.stderr.exp \
dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp
check_PROGRAMS = \
- chdir dlclose myprint.so
+ chdir clreq dlclose myprint.so
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
--- /dev/null
+
+// Prior to 3.0.1, Cachegrind was failing if run on a program that uses
+// client requests. It was fixed in 3.0.1, but then reintroduced
+// afterwards (reported as bug #116057). So here we test it.
+
+#include "../../include/valgrind.h"
+
+int main(void)
+{
+ return RUNNING_ON_VALGRIND;
+}
--- /dev/null
+prog: clreq
+vgopts: -q
+cleanup: rm cachegrind.out.*
#ifndef __PUB_TOOL_MACHINE_H
#define __PUB_TOOL_MACHINE_H
-/* VG_STACK_REDZONE_SZB: how many bytes below the stack pointer are validly
- * addressible? */
#if defined(VGA_x86)
-# define VG_MIN_INSTR_SZB 1
-# define VG_MAX_INSTR_SZB 16
-# define VG_STACK_REDZONE_SZB 0
+# define VG_MIN_INSTR_SZB 1 // min length of native instruction
+# define VG_MAX_INSTR_SZB 16 // max length of native instruction
+# define VG_CLREQ_SZB 18 // length of a client request, may
+ // be larger than VG_MAX_INSTR_SZB
+# define VG_STACK_REDZONE_SZB 0 // number of addressable bytes below SP
#elif defined(VGA_amd64)
# define VG_MIN_INSTR_SZB 1
# define VG_MAX_INSTR_SZB 16
+# define VG_CLREQ_SZB 18
# define VG_STACK_REDZONE_SZB 128
#elif defined(VGA_ppc32)
# define VG_MIN_INSTR_SZB 4
# define VG_MAX_INSTR_SZB 4
+# define VG_CLREQ_SZB 24
# define VG_STACK_REDZONE_SZB 0
#else
# error Unknown arch