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
ci: build & test util-linux on Fedora Rawhide via Packit #1924
Conversation
So far it seems to be doing the right thing, even though the collection of
|
I will take a look. Thank you for reporting. (I will use this comment to note my analysis.)
|
That's cool. @mrc0mmand thanks! |
@mrc0mmand is there a way to know the version of kernel used for running the test cases? |
Yup, in this case its |
The test suite prints the version at the beginning,
See rpm-build:fedora-rawhide-aarch64 in the list of PR checks, then "Details" -> "Dashboard URL" -> "Build Logs" where is complete output. |
@karelzak this should be almost ready, and thanks to #1936 I was able to drop one of the There's one remaining fail on
It can be reproduced locally using
This seems to work fine in an x86_64 container:
|
On fedora-rawhide-i386, it ends on NS_GET_USERNS:
Linux returns this errno when not able to identify the ioctl. IMHO the problem is the mismatch between the 64bit kernel and 32bit userspace. I guess the best would be to detect this situation and mark the test as KNOWN_FAIL. |
It seems 32bit userspace on 64bit kernel return ENOTTY for NS_GET_USERNS ioctl (for example when execute tests in mock environment). Addresses: #1924 Signed-off-by: Karel Zak <kzak@redhat.com>
@mrc0mmand so, are we ready to merge it? ;-) |
Indeed, thanks! I've rebased the PR branch, so let's see how it goes :) |
@karelzak unfortunately, the i386 build still fails:
I'll sprinkle the test with some debug logs. Also, it looks like 825feef broke build in the CodeQL Action:
Full log: https://github.com/util-linux/util-linux/actions/runs/3674306157/jobs/6212366513#step:5:937 |
Ah, I see, the workaround from 857038d doesn't work, since
|
There is no elegant way to detect kernel wordsize (32/64 bit) in an environment like mock. There is possible to use /proc/sys/kernel/osrelease (or uname -a), but this is a distribution-specific string. Things like @t-8ch, what about adding to the /proc something like |
@karelzak I'll look into it in a bit. |
While it would be possible to add a new sysfs file to skip the test, would it not be better to fix the ioctls 32bit compat? For the time being we would still need a workaround in any case. |
I have a patch that makes the ioctl work. |
As all parameters and return values of the ioctls have the same representation on both 32bit and 64bit we can reuse the normal ioctl handler for the compat handler via compat_ptr_ioctl(). All nsfs ioctls return a plain "int" filedescriptor which is a signed 4-byte integer type on both 32bit and 64bit. The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a "uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit. Fixes: 6786741 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor") Reported-by: Karel Zak <kzak@redhat.com> Link: util-linux/util-linux#1924 (comment) Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
As all parameters and return values of the ioctls have the same representation on both 32bit and 64bit we can reuse the normal ioctl handler for the compat handler via compat_ptr_ioctl(). All nsfs ioctls return a plain "int" filedescriptor which is a signed 4-byte integer type on both 32bit and 64bit. The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a "uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit. Fixes: 6786741 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor") Reported-by: Karel Zak <kzak@redhat.com> Link: util-linux/util-linux#1924 (comment) Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Yes, I've thought about the ioctl too, and it's definitely a way how to fix the core of the problem, but I still think that we need a way how to detect 32 vs. 64 bits. (I mean not for this issue, but as a generic thing.) |
@mrc0mmand can you rebase this PR? I guess with recent @t-8ch's changes; it's ready now. |
Let's run at least the unit-tests on Fedora Rawhide via Packit, as it supports a couple of alternative architectures (aarch64, ppc64le, s390x) as well as i*86, which were source of issues in the past.
That indeed seems to have done the trick, thanks! |
@karelzak Do we have a concrete usecase to argue for the new sysfs file? unsigned long wrdsz = CHAR_BIT * sizeof(void *); Anything else? PS: all tests on this PR are green. |
The packit logs currently all talk about "util-linux-2.38". It would be clearer to have some indication that is actually a development version. |
As all parameters and return values of the ioctls have the same representation on both 32bit and 64bit we can reuse the normal ioctl handler for the compat handler via compat_ptr_ioctl(). All nsfs ioctls return a plain "int" filedescriptor which is a signed 4-byte integer type on both 32bit and 64bit. The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a "uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit. Fixes: 6786741 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor") Reported-by: Karel Zak <kzak@redhat.com> Link: util-linux/util-linux#1924 (comment) Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
As all parameters and return values of the ioctls have the same representation on both 32bit and 64bit we can reuse the normal ioctl handler for the compat handler via compat_ptr_ioctl(). All nsfs ioctls return a plain "int" filedescriptor which is a signed 4-byte integer type on both 32bit and 64bit. The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a "uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit. Fixes: 6786741 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor") Reported-by: Karel Zak <kzak@redhat.com> Link: util-linux/util-linux#1924 (comment) Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Let's run at least the unit-tests on Fedora Rawhide via Packit, as it supports a couple of alternative architectures (aarch64, ppc64le, s390x) as well as i*86, which were source of issues in the past.