-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/link/internal/ld: TestFallocate consistently failing on freebsd-riscv64-unmatched #59352
Comments
Fallocate is newly enabled on FreeBSD at CL https://golang.org/cl/478035 . cc @tklauser |
ZFS on FreeBSD does not support
The reason for removal of All the other builders use UFS2 AFIK, if freebsd-riscv64-unmatched is indeed using ZFS, then we're not handling the error properly. Maybe we should test for |
I'm also seeing it on my builder which was down for a week. It is a slightly different failure mode (the filesystem is UFS1 in my case):
|
That's unfortunate, but common enough that So probably the test could use that if the system call actually returned Unfortunately, the failure mode we're seeing here is not consistent with an error return from the syscall. There is an explicit error check before the go/src/cmd/link/internal/ld/fallocate_test.go Lines 35 to 37 in 8edcddd
|
I think this is a platform-independent bug in the test (CC @golang/runtime). The size being passed to
Then the sizes passed to
But without subsequent calls to |
|
Hmm, looks like But that still wouldn't produce the observed failure mode in the test. |
Last time I looked, on all relevant platforms |
Attached the truss syscall trace from a
A ZFS directory with lz4 compression enabled reproduces the test failure with a single block:
truss log (
|
I don't see any calls to |
@paulzhol, is it possible that (The initial call to |
@bcmills
I wrote a small C program and in the trace it looks completely broken, but no EINVAL:
vs our Go
|
Looks like the C and Go programs pass arguments in different order? What arguments do your C program pass? |
#include <unistd.h>
#include <fcntl.h>
int main() {
int fd = open("file.dat", O_RDWR|O_CREAT, 0644);
posix_fallocate(fd, 0, 1024);
posix_fallocate(fd, 0, 1<<20);
close(fd);
} amd64:
i386:
armv7:
The i386 looks correct, but on arm it is as if the low qword of the len is passed as the second argument. |
Change https://go.dev/cl/481621 mentions this issue: |
Something still doesn't make sense. The freebsd-riscv64-unmatched builder exhibits the ZFS block size test failure, but the system call there presumably returns EINVAL (as seen when running the test manually on an amd64 with a ZFS filesystem). |
https://man.freebsd.org/cgi/man.cgi?query=posix_fallocate&sektion=2&n=1 says:
So I think the syscall wrapper needs to be checking the |
@tklauser there's a comment in about alignment in Lines 216 to 227 in f62c970
Is that where the 0 in your new CL coming from?And then truss or clang just use the actual value as an optimization? |
@bcmills Right, I'll adjust the CL.
Yes, I think so. Though I was using https://cs.opensource.google/go/x/sys/+/master:unix/mksyscall.go;l=237-247
I'm not sure how truss and and clang implement this :( |
https://build.golang.org/log/81f8a8d0ec2511d322c9e2f8d9ad3b170fc33866:
Looks like the same failure mode as #42005, but I'm filing a separate issue because this may be resolved on this particular builder by either reconfiguring the builder or adding a test skip.
(attn @mengzhuo; CC @golang/freebsd)
The text was updated successfully, but these errors were encountered: