Closed paulfloyd closed 4 years ago
Looking at some older versions of Valgrind, it looks like this has never worked on FreeBSD.
Possibly not as difficult as I'd feared
This test
uc = (struct vki_ucontext *)ARG1;
if (uc == NULL || uc->uc_mcontext.len != sizeof(uc->uc_mcontext)) {
SET_STATUS_Failure(VKI_EINVAL);
return;
}
in PRE(sys_fake_sigreturn) is failing with mcontext len 4227845880 sz 640 i.e., uc->uc_mcontext.len is junk
Is this right? VG_(x86_freebsd_SUBST_FOR_sigreturn): lea 0x14(%esp), %eax / args to sigreturn(ucontext_t ) */
Easy when you know how. To https://github.com/paulfloyd/freebsd_valgrind.git ead92d15f..618f1aa2c freebsd -> freebsd
Looks like ESP and/or EIP are getting corrupted
Looks like this will involve debugging
static Addr build_sigframe() in sigframe-x86-freebsd.c
VG_(x86_freebsd_SUBST_FOR_sigreturn) in trampoline.S
PRE(sys_sigreturn) in syswrap-x86-freebsd.c