Skip to content

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

Open
@Beerosagos

Description

@Beerosagos

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.

Activity

added this to the Unreleased milestone on Nov 21, 2024
changed the title [-]x/mobile: go mobile bind, crash on older Android versions[/-] [+]x/mobile: go mobile bind, SIGSYS crash on older Android versions[/+] on Nov 21, 2024
added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Nov 21, 2024
dmitshur

dmitshur commented on Nov 21, 2024

@dmitshur
Member
hajimehoshi

hajimehoshi commented on Nov 21, 2024

@hajimehoshi
Member

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

ianlancetaylor

ianlancetaylor commented on Nov 21, 2024

@ianlancetaylor
Contributor

See #70508.

changed the title [-]x/mobile: go mobile bind, SIGSYS crash on older Android versions[/-] [+]x/mobile/cmd/gomobile: bind, SIGSYS crash on older Android versions[/+] on Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hajimehoshi@dmitshur@ianlancetaylor@gopherbot@Beerosagos

        Issue actions

          x/mobile/cmd/gomobile: bind, SIGSYS crash on older Android versions · Issue #70495 · golang/go