-
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: accept(2) syscall blocked on Android, use accept4(2) instead #45767
Comments
Syscall 202 is accept which seems to match what the demonstration program does. My guess is that accept syscalls should map to accept4 on Android. We can't use accept4 on all linux because it was introduced in Linux 2.6.28 and Go's minimum is 2.6.23. I don't have the time to do this, but see https://go-review.googlesource.com/c/go/+/235537 for a similar fix to map dup2 to dup3 on Android. |
@eliasnaur off topic but is there a reason why linux support is linked to 2.6.x? it has reached EOL in Aug 2011. |
@OneOfOne That is what we've written in https://golang.org/wiki/MinimumRequirements. We could decide to increase the required version, but that should be done in a separate and longer discussion. (In particular we have to consider RHEL, CentOS, and Debian LTS requirements.) |
Change https://golang.org/cl/313769 mentions this issue: |
Change https://golang.org/cl/313690 mentions this issue: |
Android seems to block the accept syscall in newer versions. Use accept4 instead on kernel versions that support it (Linux 2.6.28 and newer) and fall back to accept on ENOSYS. Updates golang/go#45767 Change-Id: If557eaaaa0b69112bbe66ed820fbb382afb53b04 Reviewed-on: https://go-review.googlesource.com/c/sys/+/313690 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Thanks. |
Android seems to block the accept syscall in newer versions. Use accept4 instead on kernel versions that support it (Linux 2.6.28 and newer) and fall back to accept on ENOSYS. Fixes golang#45767 Change-Id: If190ace0e0213207fdaf6eeb79a5543ef18456de Reviewed-on: https://go-review.googlesource.com/c/go/+/313769 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
… accept Android seems to block the accept syscall in newer versions. Use accept4 instead on kernel versions that support it (Linux 2.6.28 and newer) and fall back to accept on ENOSYS. Fixes golang#45767 (cherry picked from golang.org/cl/313769) Change-Id: If190ace0e0213207fdaf6eeb79a5543ef18456de Reviewed-on: https://go-review.googlesource.com/c/go/+/313769 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
What version of Go are you using (
go version
)?go version go1.15.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GO111MODULE="on"
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.google.cn"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build729311614=/tmp/go-build -gno-record-gcc-switches"
What did you do?
I use gomobile to build aar with above code, then use this aar in app. When app running, I turn off the wifi, then app crash.
The text was updated successfully, but these errors were encountered: