Skip to content
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

x/mobile, runtime: libgojni.so crashes on ARM64 devices for methods defined in Go code #65057

Closed
ImagineYao opened this issue Jan 11, 2024 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. mobile Android, iOS, and x/mobile WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@ImagineYao
Copy link

Go version

go version go1.21.1 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/user/Library/Caches/go-build'
GOENV='/Users/user/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/user/go/pkg/mod'
GOOS='darwin'
GOPATH='/Users/user/go'
GOPRIVATE='*.okg.com'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go/bin'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN=''
GOTOOLDIR='/usr/local/go/bin/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/tg/6zv0sgfd1wl_f7h6_mf1clnm0000gn/T/go-build1079424989=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I use gomobile to package go project to aar.
gomobile bind -v -target=android/arm64,android/arm
when i call method defined in go project, it crashed on arm64 devices occasionally.

What did you see happen?

crashed occasionally, following is the dmp

Thread 97 (crashed)
 0  libgojni.so + 0x711d58
     x0 = 0x0000000000000000    x1 = 0x0000000000002e9e
     x2 = 0x0000000000000006    x3 = 0x0000000000000008
     x4 = 0x0000000000000001    x5 = 0xffffffffffffffff
     x6 = 0x00000077d85281f8    x7 = 0x000000000000000a
     x8 = 0x0000000000000083    x9 = 0x0000000000000031
    x10 = 0x000000000000000e   x11 = 0x00000077d8f691ce
    x12 = 0x0000000000000000   x13 = 0x0000000000000000
    x14 = 0x000000000000000e   x15 = 0x000000000000000b
    x16 = 0x00000078dcb14d80   x17 = 0x00000078dcc0ad60
    x18 = 0x0000007771f4a000   x19 = 0x0000000000001f9b
    x20 = 0x00000078dcc0ac00   x21 = 0x0000004000c6f400
    x22 = 0x0000000014c788c8   x23 = 0x000000007083e358
    x24 = 0x0000000012dc3a20   x25 = 0x0000000012dc39f8
    x26 = 0x00000078dcc0b578   x27 = 0x0000000000000000
    x28 = 0x0000004000ad0340    fp = 0x00000078dcc0b5f8
     lr = 0x00000077d85f8574    sp = 0x00000078dcc0b600
     pc = 0x00000077d8615d58
    Found by: given as instruction pointer in context
 1  libgojni.so + 0x6f4570
     fp = 0x00000078dcc0b618    lr = 0x00000077d85e156c
     sp = 0x00000078dcc0b608    pc = 0x00000077d85f8574
    Found by: previous frame's frame pointer
 2  libgojni.so + 0x6dd568
     fp = 0x00000078dcc0ba98    lr = 0x00000077d861286c
     sp = 0x00000078dcc0b628    pc = 0x00000077d85e156c
    Found by: previous frame's frame pointer
 3  libgojni.so + 0x70e868
     fp = 0x0000000000000000    lr = 0x6fbfeb8800000000
     sp = 0x00000078dcc0baa8    pc = 0x00000077d861286c
    Found by: previous frame's frame pointer

and the corresponding line is following

➜  arm64-v8a addr2line -f -C -e libgojni.so 0x711d58
runtime.raise.abi0
/usr/local/go/src/runtime/sys_linux_arm64.s:158
➜  arm64-v8a addr2line -f -C -e libgojni.so 0x6f4570
runtime.dieFromSignal
/usr/local/go/src/runtime/signal_unix.go:903
➜  arm64-v8a addr2line -f -C -e libgojni.so 0x6dd568
runtime.crash
/usr/local/go/src/runtime/signal_unix.go:985
➜  arm64-v8a addr2line -f -C -e libgojni.so 0x70e868
runtime.systemstack.abi0
/usr/local/go/src/runtime/asm_arm64.s:243

What did you expect to see?

it should not be crashed

@odeke-em odeke-em changed the title libgojni.so crashed x/mobile, runtime: libgojni.so crashes on ARM64 devices for methods defined in Go code Jan 11, 2024
@gopherbot gopherbot added compiler/runtime Issues related to the Go compiler and/or runtime. mobile Android, iOS, and x/mobile labels Jan 11, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jan 11, 2024
@odeke-em
Copy link
Member

Thank you for this report @ImagineYao! It would be helpful to produce some sort of reproduction that would make this Github issue more actionable and can be easily investigated. In the meantime I shall kindly cc some runtime and gomobile folks @cherrymui @hyangah

@odeke-em odeke-em added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 11, 2024
@ImagineYao
Copy link
Author

hello, any idea about this? @cherrymui @hyangah

@cherrymui
Copy link
Member

As @odeke-em mentioned above, could you share a way to reproduce the issue? Also, could you try the latest release, Go 1.21.6, or Go 1.22rc1? Thanks.

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 28, 2024
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. mobile Android, iOS, and x/mobile WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants