---------------------------------------------------------
3: SYS_read 3s 1m
---------------------------------------------------------
==5342== Syscall param read(buf) contains uninitialised byte(s)
==5342== at 0x4A18EBA: syscall (in /lib/libc.so.7)
==5342== by 0x201377: main (scalar.c:20)
==5342==
==5342== Syscall param read(count) contains uninitialised byte(s)
==5342== at 0x4A18EBA: syscall (in /lib/libc.so.7)
==5342== by 0x201377: main (scalar.c:20)
Where is the 'Syscall param read(fd) contains uninitialised byte(s)' error message?
This seems to work OK with x86 executables.
Strangely if I change the call to
SY(SYS_read+x0, x0, x0, x0 + 1); FAILx(EFAULT);
so that an error is expected on the syscall number as well, then I do get an error on the fd argument (but not the syscall number). It's as if there is a mixup between the 1st two syscall arguments on amd64 wrt memcheck validation.
Looking at the code in syswrap-main.c/getSyscallArgsFromGuestState the FreeBSD code does look a mess.
Starting to create a 'scalar' regtest and
generates
Where is the 'Syscall param read(fd) contains uninitialised byte(s)' error message?
This seems to work OK with x86 executables.
Strangely if I change the call to
so that an error is expected on the syscall number as well, then I do get an error on the fd argument (but not the syscall number). It's as if there is a mixup between the 1st two syscall arguments on amd64 wrt memcheck validation.
Looking at the code in syswrap-main.c/getSyscallArgsFromGuestState the FreeBSD code does look a mess.