344499 Fix compilation for Linux kernel >= 4. With this, also require
a Linux kernel >= 2.6 as 2.4 is mostly untested and might trigger
obvious and non-obvious issues
+344560 Fix stack traces missing penultimate frame on OS X
344621 Fix memcheck/tests/err_disable4 test on OS X
344686 Fix suppression for pthread_rwlock_init on OS X 10.10
344702 Fix missing libobjc suppressions on OS X 10.10
if (fps) fps[0] = uregs.xbp;
i = 1;
+# if defined(VGO_darwin)
+ if (VG_(is_valid_tid)(tid_if_known) &&
+ VG_(is_in_syscall)(tid_if_known) &&
+ i < max_n_ips) {
+ /* On Darwin, all the system call stubs have no function
+ * prolog. So instead of top of the stack being a new
+ * frame comprising a saved BP and a return address, we
+ * just have the return address in the caller's frame.
+ * Adjust for this by recording the return address.
+ */
+ ips[i] = *(Addr *)uregs.xsp - 1;
+ if (sps) sps[i] = uregs.xsp;
+ if (fps) fps[i] = uregs.xbp;
+ i++;
+ }
+# endif
+
/* Loop unwinding the stack. Note that the IP value we get on
* each pass (whether from CFI info or a stack frame) is a
* return address so is actually after the calling instruction
syscallInfo[tid].status.what = SsIdle;
}
+Bool VG_(is_in_syscall) ( Int tid )
+{
+ vg_assert(tid >= 0 && tid < VG_N_THREADS);
+ return (syscallInfo[tid].status.what != SsIdle);
+}
+
static void ensure_initialised ( void )
{
Int i;
/* Clear this module's private state for thread 'tid' */
extern void VG_(clear_syscallInfo) ( Int tid );
+// Returns True if the given thread is currently in a system call
+extern Bool VG_(is_in_syscall) ( Int tid );
+
// Fix up a thread's state when syscall is interrupted by a signal.
extern void VG_(fixup_guest_state_after_syscall_interrupted)(
ThreadId tid,
EXTRA_DIST = \
aio.stderr.exp aio.vgtest \
+ deep_badparam.stderr.exp deep_badparam.stdout.exp deep_badparam.vgtest \
env.stderr.exp env.vgtest \
pth-supp.stderr.exp pth-supp.vgtest \
scalar.stderr.exp scalar.vgtest \
check_PROGRAMS = \
aio \
+ deep_badparam \
env \
pth-supp \
scalar \
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int func_six(int x)
+{
+ char b[32];
+ int r = write(1, b, sizeof(b));
+ return x;
+}
+
+int func_five(int x)
+{
+ return func_six(x + 5);
+}
+
+int func_four(int x)
+{
+ return func_five(x + 4);
+}
+
+int func_three(int x)
+{
+ return func_four(x + 3);
+}
+
+int func_two(int x)
+{
+ return func_three(x + 2);
+}
+
+int func_one(int x)
+{
+ return func_two(x + 1);
+}
+
+int main(void)
+{
+ func_one(10);
+ return 0;
+}
--- /dev/null
+Syscall param write(buf) points to uninitialised byte(s)
+ ...
+ by 0x........: func_six (in ./deep_badparam)
+ by 0x........: func_five (in ./deep_badparam)
+ by 0x........: func_four (in ./deep_badparam)
+ by 0x........: func_three (in ./deep_badparam)
+ by 0x........: func_two (in ./deep_badparam)
+ by 0x........: func_one (in ./deep_badparam)
+ by 0x........: main (in ./deep_badparam)
+ Address 0x........ is on thread 1's stack
+ in frame #1, created by func_six (???:)
+
--- /dev/null
+prog: deep_badparam
+vgopts: -q