x/mobile: getaddrinfo triggers fdsan_error on Android
Opened this issue · 0 comments
lwintermelon commented
Go version
go version go1.25.3 linux/amd64
Output of go env in your module/workspace:
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1330428599=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/root/project/tnasonline/go.mod'
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY='example.com'
GONOSUMDB='example.com'
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE='example.com'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.3'
GOWORK=''
PKG_CONFIG='pkg-config'What did you do?
I build a dynamic library for android with go, NDK and expose it with cgo and jni. The android app use it with .h and .so file.
What did you see happen?
It will trigger fdsan on Android 11.
Below are backstraces.
1
#00 pc 00000000000a2420 /apex/com.android.runtime/lib64/bionic/libc.so (fdsan_error(char const*, ...)+448) [arm64-v8a::a87e89fc2c0a5753053f536add4d7ae1]
2
#01 pc 0000000000103388 /apex/com.android.runtime/lib64/bionic/libc.so (fdopen+312) [arm64-v8a::a87e89fc2c0a5753053f536add4d7ae1]
3
#02 pc 00000000000ba8e4 /apex/com.android.runtime/lib64/bionic/libc.so (android_getaddrinfo_proxy+164) [arm64-v8a::a87e89fc2c0a5753053f536add4d7ae1]
4
#03 pc 00000000000ba62c /apex/com.android.runtime/lib64/bionic/libc.so (android_getaddrinfofornetcontext+1580) [arm64-v8a::a87e89fc2c0a5753053f536add4d7ae1]
5
#04 pc 00000000000b9f74 /apex/com.android.runtime/lib64/bionic/libc.so (getaddrinfo+52) [arm64-v8a::a87e89fc2c0a5753053f536add4d7ae1]
6
#05 pc 0000000000e9af54 /data/app/~~FkdOhQM61hEuwinHP_xDig==/com.example.placehodler-BNM7k1UCu7Y4iAR0XkgQLg==/lib/arm64/libexample.so (_cgo_90c9abb7659c_C2func_getaddrinfo+48) [arm64-v8a::0a671204011b0d9f5117e274e9cf5a1b]
7
#06 pc 000000000054b6c8 /data/app/~~FkdOhQM61hEuwinHP_xDig==/com.example.placehodler-BNM7k1UCu7Y4iAR0XkgQLg==/lib/arm64/libexample.so (runtime.call262144.abi0+232) [arm64-v8a::0a671204011b0d9f5117e274e9cf5a1b]
8
java:
9
[Failed to get Java stack]
What did you expect to see?
It won't trigger fdsan.
It may be triggered by my library code, but I have checked it and I wonder if it's caused by go runtime.
Does anyone else see same problems?
Some links about fdsan on android.