Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2008 08:23:42 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 152254 for review
Message-ID:  <200810310823.m9V8Nguo002120@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152254

Change 152254 by peter@peter_overcee on 2008/10/31 08:23:15

	Fix the !@^#!$@^!@# bug that I've been looking for over the last 5
	days.  Add 8 bytes of padding to fake the return address for syscalls
	that have memory args.
	
	Basic valgrind functionality on 64 bit!  (runs /bin/ls etc!)

Affected files ...

.. //depot/projects/valgrind/coregrind/m_syscall.c#8 edit

Differences ...

==== //depot/projects/valgrind/coregrind/m_syscall.c#8 (text+ko) ====

@@ -349,14 +349,15 @@
 "       movq    24(%rsp), %rcx\n" /* a8 from stack */
 "       pushq	%rcx\n"
 "       pushq	%r11\n"
+"	subq	$8,%rsp\n"	/* fake return addr */
 "	syscall\n"
 "	jb	1f\n"
-"	addq	$16,%rsp\n"
+"	addq	$24,%rsp\n"
 "	movq	40(%rsp),%rsi\n"
 "	movq	%rdx, (%rsi)\n"
 "	ret\n"
 "1:\n"
-"	addq	$16,%rsp\n"
+"	addq	$24,%rsp\n"
 "	movq	32(%rsp), %rsi\n"
 "	movl	$1,(%rsi)\n"
 "	ret\n"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810310823.m9V8Nguo002120>