Closed AGSaidi closed 3 years ago
In 2.3.3, we're calling __xstat with a hardcoded _STAT_VER of 1, which works on x86_64, but may fail on other platforms (like aarch64).
Given that LSB 1.3 predates the 64b Arm architecture and says version 3 is required, what is the reason for choosing 0?
This is straight from the Linux SDK (/usr/include/aarch64-linux-gnu/sys/stat.h).
I've actually simplified this further by just using _STAT_VER directly from the SDKs that I'm using to crosscompile (commit a57b246cf82460482802422e72c363b6f300ad08).
We will have to make sure this doesn't again break some obscure old glibc from two decades ago, so this would need further testing.
I think the man page in https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/baselib-xstat-1.html is just outdated (3
seems to apply to 31/32-bit systems and S390x?), and "version" as in "increasing over time" apparently is not what the authors had in mind here.
In reality, _STAT_VER is just a platform-dependent marker that indicates the format of the struct stat
that is returned by the kernel.
All in all, it looks like "stat" has had quite the tumultuous history (different formats on different platforms, sometimes not defined as function but a macro, etc.).
Please verify with this build (version 2.3.4 currently in staging only).
Tested on Arm versions of Ubuntu 18.04, CentOS7, and Amazon Linux2 successfully:
Selftest results:
PASS junixsocket-common 37/39 (2 skipped)
PASS junixsocket-rmi 5/5
Supported capabilities: [CAPABILITY_PEER_CREDENTIALS, CAPABILITY_ANCILLARY_MESSAGES, CAPABILITY_FILE_DESCRIPTORS, CAPABILITY_ABSTRACT_NAMESPACE]
Unsupported capabilities: []
Thanks for verifying, @AGSaidi!
junixsocket 2.3.4 has been released to Maven central and GitHub.
Describe the bug junixsocket 2.3.3 fails to run selftests on Linux-aarch64
To Reproduce Steps to reproduce the behavior:
Expected behavior Self tests should pass as they do on 2.3.2
Output/Screenshots See above
Environment (please complete the following information):
java -jar junixsocket-selftest-x.y.z-SNAPSHOT-jar-with-dependencies.jar
(x.y.z being the latest version, e.g., 2.3.3). — The selftest jar is available from the junixsocket-dist package in the Release section.Notes