runtime: Sycall Call function modifies value of procedure argument which is underlyingly immutable #48035
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In the rawest form, this is what I'm doing. I don't know if there's any Go playground servers which run Windows, so I haven't tried reproducing this issue in it, yet.
getHealth does the following:
readMemory does the following:
ReadProcessMemory has the following as the first 2 arguments: a process handle, a
const void*
.I'm respectively passing a base address which is the result of turning a pointer into an uintptr, then combining that value with 0x100 in this scenario.
I don't see how WINAPI could be at fault modifying underlying content even though it'd have the 'permission' to overwrite what we're pointing at. Even then, though, I'm passing a result of an operation, not the raw pointer itself, which is the one being modified. I think it's the result of a direct semantic in Go?
What did you expect to see?
address, same address, health (an integer that goes from 0 to 100), same address as the former two
What did you see instead?
address, same address, (correct) health, new address which is consistent on all runs (0x6480) (changes according to the ptrdiff passed in get(...), but stays consistent with the same ptrdiff.)
For more context: I have more RPM calls within my software, and they don't cause any side effect as this procedure. This is the only, unique case where this happens. In the aforementioned, I also have the scenario where I take a pointer, convert it to an uintptr, then use that value for combination, then read at the newly produced address.
The text was updated successfully, but these errors were encountered: