I was lazy and using pointers to the same struct for the new and old
data (which isn't allowed, the new is 'restrict'). The current gets
copied to the old first so under Valgrind it worked. In the kernel
there are separate structs (which get copied in and copied out) and
it doesn't work.
Maybe we should consider changing VG_(do_sys_sigaltstack) to have at
least one local copy in order to behave like the kernel.
char *ss_sp;
size_t ss_size;
int ss_flags;
- } ss;
- ss.ss_sp = NULL;
- ss.ss_flags = 0;
- ss.ss_size = 0;
- VALGRIND_MAKE_MEM_NOACCESS(& ss, sizeof(struct our_sigaltstack));
+ } ss = { NULL, 0, 0};
+ struct our_sigaltstack oss;
+ VALGRIND_MAKE_MEM_NOACCESS(&ss, sizeof(struct our_sigaltstack));
+ VALGRIND_MAKE_MEM_NOACCESS(&oss, sizeof(struct our_sigaltstack));
GO(SYS_sigaltstack, "2s 2m");
- SY(SYS_sigaltstack, x0+&ss, x0+&ss); SUCC; /* FAIL when run standalone */
+ SY(SYS_sigaltstack, x0+&ss, x0+&oss); FAIL;
}
/* SYS_ioctl 54 */