-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
syscall: audit missing syscalls on linux/arm64 #10235
Comments
At least the following deprecated syscalls still need wrappers for arm64: There are also some syscalls in the unimplemented table that need to be taken care when implemented: evenfd -> eventfd2 |
looking at glibc, pause is implemented as and time is implemented as gettimeofday from the vdso. - which is how go seems to do Time on amd64 as well. |
And dup2 -> dup3 wrapper needed (see #11981) |
Any way to make this less unplanned? I keep bumping into go packages that naively call syscalls not being aware they have been deprecated and are not available on arm64.. cc @davecheney and @4ad |
@suihkulokki, which? Those packagess are buggy, then. Using syscall is like using unsafe... you have to really know what you're doing. They probably don't run well on Windows or Plan 9 or Solaris either. |
@bradfitz This is typically linux-specific code, such as some of the libraries used by docker (example: libcontainer) or code where linux implementation is in a different file then windows one (fsnotify). Both examples have now fixes commited, but I expect that more are being created as we talk. Developers are not aware that bunch of syscalls go provides are actually deprecated ones, because they work just fine on amd64. My faith that people who use the syscall package know what they are doing is not very strong... |
People that use the syscall package (and unsafe, as already mentioned) should know what they are doing. It's not clear to me why we should cater to poorly-written programs, thereby decreasing their incentive to move to the go.sys package even more. |
Ok, I didn't know about go.sys. However, the same problems are there too. People who need Epoll will use EpollCreate() instead of EpollCreate1() because nothing hints that the former is deprecated. We can:
I would assume 2, is preferred choice, since the current arm64 has a bunch already, example: https://github.com/golang/sys/blob/master/unix/syscall_linux_arm64.go#L132 |
But what about the unimplemented syscall.EpollPwait() when syscall.EpollWait() is supposedly deprecated? Unless I am mistaken, there is currently no way out for ARM64: syscall.EpollWait() gives ENOSYS: function not implemented error (from Linux kernel), but EpollPwait is not yet implemented in Go. This currently affects fsnotify, which in turn affects Hugo and others, see go-fsnotify/fsnotify#112 and gohugoio/hugo#1772 @bradfitz, I see that you dealt with a similar issue for the Perl Sys::Syscall package at bradfitz/sys-syscall#6, so you can't simply dismiss that that Linux-specific code requiring syscall.EpollPwait() as buggy, right? 😉 Should this problem be addressed here, or over at golang.org/x/sys? Many thanks! |
It should be addressed at x/sys/unix. Thanks.
|
Thank you @minux! (对不起,昨天有眼不识泰山,一下子没认出来!)感谢 Minux 大神! 🙏 |
Kubernetes is affected by this also as I'm adding support for |
This has nothing to do with Go, it has to do with Linux: http://linux.die.net/man/2/dup3 |
I would say https://golang.org/src/syscall/syscall_linux.go#L933 contains a good list of unimplemented syscalls. In particular I'm missing the syscalls about extended attributes on symlinks:
|
CL https://golang.org/cl/20178 mentions this issue. |
arm64 doesn't have a Dup2 syscall, instead Dup3 is supposed to be used. Since Dup3 is linux-specific, provide a wrapper to make writing portable code easier. Updates golang/go#10235 To verify it, added a testcase for Dup and Dup2. Change-Id: I066bb60d62b2bd64d7ba0fdfbb334ce2213c78e9 Reviewed-on: https://go-review.googlesource.com/20178 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I've hopefully implemented missing ones for arm64 in x/sys/unix . What was left is Ustat, which I think is too obscure to bother wrapping. Use Statfs instead. |
@suihkulokki Thanks! Closing this issue on the assumption that the work is done. |
Thanks, feel free to @ me if new issues with arm/arm64 syscalls appear. |
Despite our efforts, it seems there are still syscalls in the syscall
package that are missing on linux/arm64.
Getpgrp is one.
The text was updated successfully, but these errors were encountered: