-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall: the wrong sysctl was gimped on iOS #35101
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
Comments
CC @crawshaw |
Change https://golang.org/cl/202778 mentions this issue: |
Change https://golang.org/cl/202837 mentions this issue: |
@gopherbot Please backport this to 1.13, because it fixes a grave regression in the net package introduced in 1.13.3. |
Backport issue(s) opened: #35105 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
While the other BSDs use __sysctl as the name, Darwin now uses sysctl, without the leading underscores, and considers __sysctl to be "private". Using __sysctl leads to App Store rejections, and Go's syscall package already uses the proper syscall. So this commit changes Darwin's syscall to use it too here, while reverting a recent commit that removed it all together on arm and arm64. This reverts CL 194097. Fixes golang/go#35103 Updates golang/go#34133 Updates golang/go#35101 Change-Id: Ic72d5e7a435b99fe62c533b77b2c3790590f4c9e Reviewed-on: https://go-review.googlesource.com/c/sys/+/202837 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Change https://golang.org/cl/202779 mentions this issue: |
This change broke macOS 10.14 at least.
Compiling this program results in:
|
The darwin assembly files still refer to
|
Change https://golang.org/cl/202958 mentions this issue: |
CL 202837 forgot to properly re-generate zsyscall_darwin_{386,amd64,arm64}.s with the correct trampoline name. Updates golang/go#35103 Updates golang/go#34133 Updates golang/go#35101 Change-Id: I98805988f97c7ff51da858fdc36c436aa680c8c7 Reviewed-on: https://go-review.googlesource.com/c/sys/+/202958 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
This was disabled due to a report that the App Store rejects the symbol __sysctl. However, we use the sysctl symbol, which is fine. The __sysctl symbol is used by x/sys/unix, which needs fixing instead. So, this commit reenables sysctl on iOS, so that things like net.InterfaceByName can work again. This reverts CL 193843, CL 193844, CL 193845, and CL 193846. Fixes #35105 Updates #35101 Updates #34133 Updates #35103 Change-Id: Ib8eb9f87b81db24965b0de29d99eb52887c7c60a Reviewed-on: https://go-review.googlesource.com/c/go/+/202778 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/202779 Reviewed-by: Elias Naur <mail@eliasnaur.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
In issue #34133, @mmaxim reported that the app store was rejecting his app due to the use of __sysctl, which he blamed on the Go runtime. Others didn't seem to have the problem, but @mmaxim said that things were accepted by the app store if he went back to Go 1.10. @eliasnaur considered this to be confirmation of the problem and removed sysctl on iOS from Go 1.14 and backported that to Go 1.13.3.
Unfortunately the diagnosis was incorrect.
__sysctl
is undocumented, butsysctl
is documented. The Go runtime usessysctl
. However,x/sys/unix
uses__sysctl
. @mmaxim noticed that Go 1.10 worked for him, because going back that far switched his vendored x/sys/unix over to using raw syscalls instead of going through libSystem.This is a regression, breaking wireguard-apple's use of
net.InterfaceByName
, which uses sysctl under the hood.The text was updated successfully, but these errors were encountered: