From: Julian S. <js...@ac...> - 2005-02-28 17:25:08
|
(in the cvs head) There seem to be paths through this which do not assign any value to SYSRES. I don't see how this can be right if this is a Special syscall (for which we provide all handling). If (a4 & VKI_MAP_FIXED) is taken and !VG_(valid_client_addr)(...) is not taken then we hit if (SYSRES != -VKI_ENOMEM) ... and read SYSRES without having set it first. What am I missing? Same problem for sys_rt_sigaction and sys_rt_sigprocmask. ----------------------------- Background: I'm tracking down problems in syscall handling on amd64. As part of that, I've added a per-thread Bool used to indicate when a syscall's PRE wrapper has set RES, so that we don't have to figure this out by inspecting RES after the pre-wrapper. Checking RES <= 0 after the pre-wrapper is the wrong thing to do and causes merry hell with __NR_read on amd64. Inspecting RES after the pre-wrapper for <= 0 also makes it impossible for a pre-wrapper to return any result > 0, which isn't good. Generally you can't reliably conclude anything at all about whether the pre-wrapper assigned RES by inspecting it afterwards. As a side effect of this, I added an assertion to check that RES has been set after every syscall marked Special (fair enough, right?) and immediately I have it barfing on mmap. J |