-
Notifications
You must be signed in to change notification settings - Fork 256
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
On mips64le, syscall.Getdents calls the old getdents syscall #200
Comments
Bear with me for a second, I have to dig a little to understand what is going on... On mips64le, as you noted,
And
In Go mips64le, syscall.Dirent is defined here https://github.com/golang/go/blob/bcc86d5f42fddc2eca1bb066668388aa6807c38c/src/syscall/ztypes_linux_mips64le.go#L133 :
And this is wrong, because it has a |
Reported upstream as golang/go#23624 . The fix for gocryptfs will be to switch to
|
Thanks for addressing this so quickly! Would you like to see a pull request for the switch to |
Thanks for the offer, but I think I'll have time later today to do it myself |
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our Getdents implementation to return garbage ( #200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros.
@lechner Pushed to master. I'll assume this fixes the problem on mips - please reopen if it does not! |
For go-fuse, this usage of syscall.Dirent is problematic: https://github.com/hanwen/go-fuse/blob/6975cb38d30430450455caad8a62d5eba93e0e4e/fuse/test/xfs_test.go#L34 But it looks like this should be switched to unix.Dirent as well. I'll send a PR. |
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros.
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros. This issue has been reported by Debian maintainer Felix Lechner.
First of all, gocryptfs now builds on mips64le. As you can see in the log, all tests pass. Thank you! The issue you found in Go-Fuse may be limited to the tests, which do not presently run in Debian. Perhaps I should connect with Hanwen about that. In an unrelated issue Thank you for all your hard work, and also for providing such high quality software! |
Here are some reasons why |
Well, go-fuse uses Stupid question: Why to you use gccgo? Acc. to https://golang.org/dl/ the standard Go compiler seems to support s390x since v1.7.1. |
Timespec seems to be identical in
|
Great question! It may not be worth your time, but Debian's reasons for using As for |
I found out that gccgo provides the familiar "go" command as well, so I tried it on amd64. I got the Timespec error, but when I commented out this part, I got the next error:
...and I suspect there are more to come. Getting gccgo to work will need a lot of workarounds... |
Looks like the old s390x build log for 1.3. Maybe it's yet another reason to switch to golang.org/x/sys/unix? |
I don't know, shouldn't this be fixed in gccgo? |
Well, if they have the same policies regarding |
^^ |
How about when you switch from |
With commit 72815b2 I'm down to this error, which seems hard to fix:
|
How about getting rid of |
Looks like the C-defined types are not being resolved to elementary types. Maybe gccgo should use |
Reason for its existence is that I am using https://godoc.org/github.com/hanwen/go-fuse/fuse#Attr.FromStat , but I don't see why our own AttrFromUnixStat would be uglier than our Unix2syscall. I have created ticket #201 to track gccgo compat. |
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros. This issue has been reported by Debian maintainer Felix Lechner.
From Debian packaging. On mips64le, golang developers provided the older
getdents
syscall instead of the newergetdents64
. Gocryptfs (and also Go-Fuse) depends on the newer syscall and produces nonsensical output on mips64le.The
Dirent
structure that ships with golang was not meant be be used withgetdents
but with glibc'sreaddir
(at least on Linux, please see NOTES in manpage). By coincidence or by design, it works with the newer syscall and is often used that way, but it does not work as shipped in golang on mips64le. An important difference is the implementation of theType
member, which was declared explicitly for the newer call. In the olderlinux_dirent
structure it is located atReclen - 1
. One could perhaps make a case thatsyscall.Getdirent
should be renamed on mips64le, or that both calls should be provided.While we could probably fix gocryptfs via build constraints, I think the issue should be addressed upstream. What do you think, please? Thank you!
The text was updated successfully, but these errors were encountered: