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: go mobile bind, SIGSYS crash on older Android versions #70495

Open
Beerosagos opened this issue Nov 21, 2024 · 4 comments
Open

x/mobile: go mobile bind, SIGSYS crash on older Android versions #70495

Beerosagos opened this issue Nov 21, 2024 · 4 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Beerosagos
Copy link

Beerosagos commented Nov 21, 2024

Go version

go version go1.23.2 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/opt/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/opt/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/go_dist/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/go_dist/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/opt/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/go.mod'
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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2246426898=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Built an Android app that includes a go module compiled with

gomobile bind -x -a -glflags="-mod=readonly" -ldflags="-s -w" -target android -androidapi 21 .

And included it with a build.gradle dependency:

dependencies {
    [...]
    implementation project(path: ':myGoModule')
}

using

    compileSdk 34
    minSdkVersion 21
    targetSdkVersion 34

What did you see happen?

Since our last upgrade to go1.23, the compiled Android app crashes at startup on older Android versions (tested 9.0 and 10.0, i.e. API 28 and 29 on Android studio emulator) with the following error:

2024-11-21 15:13:36.524 17389-17472 GoLog                   ch.shiftcrypto.bitboxapp.debug       E  [WARNING:viz_main_impl.cc(85)] VizNullHypothesis is disabled (not a warning)
2024-11-21 15:13:36.780 17389-17472 GoLog                   ch.shiftcrypto.bitboxapp.debug       E  [1121/151336.779929:ERROR:elf_dynamic_array_reader.h(64)] tag not found
2024-11-21 15:13:36.796 17389-17470 libc                    ch.shiftcrypto.bitboxapp.debug       A  Fatal signal 31 (SIGSYS), code 1 (SYS_SECCOMP) in tid 17470 (bitboxapp.debug), pid 17389 (bitboxapp.debug)
2024-11-21 15:13:36.829 17489-17489 DEBUG                   pid-17489                            A  pid: 17389, tid: 17470, name: bitboxapp.debug  >>> ch.shiftcrypto.bitboxapp.debug <<<
2024-11-21 15:13:36.829 17489-17489 DEBUG                   pid-17489                            A      #00 pc 00124bee  /data/app/ch.shiftcrypto.bitboxapp.debug-E5gwW0mWuw-zSOShuc4uzA==/lib/x86/libgojni.so

Everything works fine for newer Android versions (e.g. 13.0).

Upgrading to Go 1.23.3 doesn't solve the issue, but reverting to Go 1.22.4 does, on all the Android versions tested.

What did you expect to see?

The app should not crash on startup.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Nov 21, 2024
@gopherbot gopherbot added this to the Unreleased milestone Nov 21, 2024
@Beerosagos Beerosagos changed the title x/mobile: go mobile bind, crash on older Android versions x/mobile: go mobile bind, SIGSYS crash on older Android versions Nov 21, 2024
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 21, 2024
@dmitshur
Copy link
Contributor

CC @hajimehoshi.

@hajimehoshi
Copy link
Member

I have no idea. Isn't this a compiler issue?

@ianlancetaylor
Copy link
Contributor

See #70508.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants