-
Notifications
You must be signed in to change notification settings - Fork 18k
x/sys/unix: IoctlGetInt broken on 64-bit big-endian platforms #60429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(CC @tklauser @golang/s390x @golang/ppc64) |
I guess the underlying issue was already discovered, #45585. |
I also wasn't aware of IoctlGetUint32. That solves my original problem (emulating tcgetpgrp), so the only remaining issue is documentation: IoctlGetInt is inconsistent with IoctlSetPointerInt, which is needed to emulate tcsetpgrp. |
Just quickly skimming this, I think that indeed it would be sufficient to just document this. Though, we should also just fix GetInt on the platforms where it's broken. (Document the "int" discrepancy and then do a conversion inside GetInt on the affected platforms.) Would you be willing to send a CL for this? :) (https://go.dev/doc/contribute) |
Does this need fixing? |
…alSize and physicalSize. x/sys/unix: IoctlGetInt broken on 64-bit big-endian platforms. issue: golang/go#60429 Due to this issue logicalSize and physicalSize are getting incorrectly populated for s390x. As a result of this the vmi creation is failing when we specify the block size. So using IoctlGetUInt32 instead of IoctlGetInt. Signed-off-by: Vamsi Krishna Siddu <vamsikrishna.siddu@ibm.com>
…alSize and physicalSize. x/sys/unix: IoctlGetInt broken on 64-bit big-endian platforms. issue: golang/go#60429 Due to this issue logicalSize and physicalSize are getting incorrectly populated for s390x. As a result of this the vmi creation is failing when we specify the block size. So using IoctlGetUInt32 instead of IoctlGetInt. Signed-off-by: Vamsi Krishna Siddu <vamsikrishna.siddu@ibm.com>
…alSize and physicalSize. x/sys/unix: IoctlGetInt broken on 64-bit big-endian platforms. issue: golang/go#60429 Due to this issue logicalSize and physicalSize are getting incorrectly populated for s390x. As a result of this the vmi creation is failing when we specify the block size. So using IoctlGetUInt32 instead of IoctlGetInt. Signed-off-by: Vamsi Krishna Siddu <vamsikrishna.siddu@ibm.com>
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?(using QEMU on an amd64 host)
What did you do?
What did you expect to see?
Same number twice, as on amd64:
What did you see instead?
The first number is 101994<<32. I believe this happens because IoctlGetInt passes a pointer to a Go int to the system call:
The ioctl system call expects a pointer to a C int. Passing a Go int means it stores the pgid in the upper 32 bits.
Note that IoctlSetPointerInt passes a pointer to an int32:
The text was updated successfully, but these errors were encountered: