You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
archFnHasSideEffects classifies whether a primitive function has implicit side effects or not, with each architecture having different implementations. I was surprised to learn that each architecture classifies system calls differently vis-à-vis side effects. macaw-x86 classifies syscalls as having side effects:
--| The existing architecture specific functions have no side effects
riscvPrimFnHasSideEffects::RISCVPrimFnrvftp->Bool
riscvPrimFnHasSideEffects =constFalse
This feels inconsistent. I would think that system calls should be treated as having side effects, although I don't have a concrete example where classifying them as side-effect–free would cause them to go wrong.
The text was updated successfully, but these errors were encountered:
It depends to some extent on which things you consider side effects, which is sort of a fraught question (e.g. is the effect of kill(getpid(), SIGSEGV) a side effect or just a program step?) but in general yes they do, and while going wrong is probably not that likely in an environment that isn't trying to model the system/kernel state, consider unlinking a file (which can cause a subsequent repeated syscall to behave differently) or, more extreme, forking a subprocess that updates a shared memory region.
From Macaw's perspective, "side effectful" means "should always be considered as being demanded when performing CFG dependency analysis" (see this code). To add a further wrinkle, Macaw doesn't encode the semantics of any system calls directly, but instead provides a generic system call hook that lets users attach whatever semantics they want to any system call. As such, I think Macaw must be conservative here and assume that the side effects must be extreme enough to warrant returning True here.
archFnHasSideEffects
classifies whether a primitive function has implicit side effects or not, with each architecture having different implementations. I was surprised to learn that each architecture classifies system calls differently vis-à-vis side effects.macaw-x86
classifies syscalls as having side effects:macaw/x86/src/Data/Macaw/X86/ArchTypes.hs
Line 1082 in 83d3907
But neither AArch32 nor RISC-V do:
macaw/macaw-aarch32/src/Data/Macaw/ARM/Arch.hs
Lines 554 to 556 in 83d3907
macaw/macaw-riscv/src/Data/Macaw/RISCV/Arch.hs
Lines 137 to 139 in 83d3907
This feels inconsistent. I would think that system calls should be treated as having side effects, although I don't have a concrete example where classifying them as side-effect–free would cause them to go wrong.
The text was updated successfully, but these errors were encountered: