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/bind/objc: EXC_BAD_ACCESS when building for iOS #14778

Closed
rpdprd opened this issue Mar 11, 2016 · 5 comments
Closed

x/mobile/bind/objc: EXC_BAD_ACCESS when building for iOS #14778

rpdprd opened this issue Mar 11, 2016 · 5 comments

Comments

@rpdprd
Copy link

rpdprd commented Mar 11, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go1.6, gomobile version +6fca37c Thu Mar 3 15:03:45 2016 +0000 (android,ios); androidSDK=
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/joesmith/Desktop/projects/sliceone/"
    GORACE=""
    GOROOT="/Users/joesmith/Desktop/go/1.6"
    GOTOOLDIR="/Users/joesmith/Desktop/go/1.6/pkg/tool/darwin_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
  3. What did you do?
    Followed https://medium.com/@rakyll/calling-go-from-swift-be88709942c3, built the hello library.

Screenshot

It seems to work fine up to 988d17d203b37629f567701771685077ac5e1174, but 6fca37c69e243b777b0910e0fa6a32125159f4fc and beyond end up triggering the EXC_BAD_ACCESS error.

@hyangah hyangah added this to the Unreleased milestone Mar 11, 2016
@hyangah hyangah changed the title x/mobile: EXC_BAD_ACCESS when building for iOS x/mobile/bind/objc: EXC_BAD_ACCESS when building for iOS Mar 11, 2016
@hyangah
Copy link
Contributor

hyangah commented Mar 11, 2016

/cc @eliasnaur @rakyll

@eliasnaur
Copy link
Contributor

Nasty. I can reproduce the crash only on an actual device if I force it to run armv7. It happens from an ObjC project as well. Perhaps it has something to do with #12896. Still investigating.

Update: Or possibly related to a variant of #12681

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/20621 mentions this issue.

@hyangah hyangah modified the milestones: Go1.6.1, Unreleased Mar 12, 2016
@eliasnaur
Copy link
Contributor

CL 20261 should fix the issue for Go tip, and it might be included in a Go 1.6.1 release. In the meantime, Go 1.5 does seem to work on darwin/arm.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/22049 mentions this issue.

gopherbot pushed a commit that referenced this issue Apr 14, 2016
CL 14603 attempted to preserve the callee-save registers for
the darwin/arm runtime initialization routine, but I believe it
wasn't sufficient and resulted in the crash reported in issue

Saving and restoring the registers on the stack the same way
linux/arm does seems more obvious and fixes #14778, so do that.

Even though #14778 is not reproducible on darwin/arm64, I applied
a similar change there, and to linux/arm64 which obeys the same
calling convention.

Finally, this CL is a candidate for a 1.6 minor release for the same
reason CL 14603 was in a 1.5 minor release (as CL 16968). It is
small and only touches the iOS platforms and gomobile on darwin/arm
is currently useless without it.

Fixes #14778
Fixes #12590 (again)

Change-Id: I7401daf0bbd7c579a7e84761384a7b763651752a
Reviewed-on: https://go-review.googlesource.com/20621
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22049
@golang golang locked and limited conversation to collaborators Apr 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants