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 Code Crashes LLDB in Simulator Environment. #19846

Closed
hwchong opened this issue Apr 5, 2017 · 16 comments
Closed

x/mobile: Go Mobile Code Crashes LLDB in Simulator Environment. #19846

hwchong opened this issue Apr 5, 2017 · 16 comments
Labels
FrozenDueToAge 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

@hwchong
Copy link

hwchong commented Apr 5, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.8 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

Built and used a go program into a go mobile dynamic framework. LLDB crashes on the Mac simulator but runs fine on device.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

LLDB to not crash.

What did you see instead?

LLDB crashing. Crash log is attached.
CrashLogs.zip

@gopherbot gopherbot added this to the Unreleased milestone Apr 5, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Apr 5, 2017

/cc @eliasnaur

@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 5, 2017
@eliasnaur
Copy link
Contributor

I've never used LLDB on macOS, so could you please give me a step-by-step guide to how to reproduce the problem. Please include any source code I'll need as well.

Also, what macOS and Xcode version are you using?

@hwchong
Copy link
Author

hwchong commented Apr 6, 2017

screenshot crash
@eliasnaur so this is the standard debugger for Xcode and iOS. I've attached a sample Xcode project, the Go mobile framework and the corresponding Go source code.

All you have to do is build the project, let it run for a few seconds and watch the crash occur on the console in Xcode.
git.clinicloud.com.zip

The project is rather large because of the framework. I've uploaded to this link -
https://appbryo-my.sharepoint.com/personal/hon_clinicloud_com/_layouts/15/guestaccess.aspx?docid=0819c0001cb5c4964bf5d8586dd1b2a27&authkey=AchwSlqH-kVixXPxvI7l9PY

Thanks!

@lucalooz
Copy link

We have the same issue by just following the wiki
https://github.com/golang/go/wiki/Mobile#sdk-applications-and-generating-bindings with the HelloGreetings example

@lucalooz
Copy link

It seems to work on Xcode 8.2.1 on OS X 10.11.6 but it doesn't on Xcode 8.3.1 on macOS Sierra

@JeanJoskin
Copy link

I'm currently working around this by disabling the goroutines plugin (which causes the crash) in lldb by adding

settings set plugin.os.goroutines.enable false

to my ~/.lldbinit

@eliasnaur
Copy link
Contributor

I've just now tried the golang.org/x/mobile/example/bind/ios example using Xcode 8.3.2 with both Go tip and Go 1.8.1. Both versions worked for me with no crashes even after several minutes of running the project through Xcode. Could you retry with Go 1.8.1 and see if your error persists?

@Tylerc230
Copy link

I'm able to reproduce with go 1.8.1 and xcode 8.3.2. The error occurs when the debugger hits a breakpoint in xcode.

@eliasnaur
Copy link
Contributor

Ok, setting a breakpoint provokes the debugger crash for me as well, thanks. However, I don't have time to dig deeper into this hairy issue, so any help fixing or pinpointing the problem will be appreciated a lot.

@Tylerc230
Copy link

Sorry, I'm not very familiar with this system. The error in xcode console directs you to the crash logs at ~Library/Logs/DiagnosticReports/lldb-rpc-server*

@zjw1918
Copy link

zjw1918 commented Jun 8, 2017

Same problem with xcode 8.3.3. But 8.2.x and before is ok.
Sometimes there are errors with " linked wrong...".
If I add my Go test xxx.framework and UI button click event, can just run, but no click event nslog happened.

@nehayward
Copy link

Any update on fixing this?

@bossbei
Copy link

bossbei commented Jul 5, 2017

Same problem with xcode 8.3.3.

@bradfitz bradfitz added the mobile Android, iOS, and x/mobile label Jul 20, 2017
@eliasnaur
Copy link
Contributor

I don't think we can do much on our side other than using the workaround from #19846 (comment) . FWIW, I've reported the crash to Apple, and they marked my bug as a duplicate.

@remirobert
Copy link

#19846 (comment) worked for me ✨👍

@eliasnaur
Copy link
Contributor

The workaround is no longer necessary for me on Xcode 9.

@golang golang locked and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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