go: x/mobile: iOS apps crash on launch since 1.16

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

1.16/1.17

Does this issue reproduce with the latest release?

Yes

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

iOS arm 64

What did you do?

iOS apps, built with Fyne, work on my iOS devices when built with Go 1.14/1.15. The same apps show but then close immediately if built with 1.16/1.17.

What did you expect to see?

The app should stay running

What did you see instead?

The app becomes visible but then closes. No log, no crash.

According to Apple developers this seems to be something in Go(mobile) shutting down the app cleanly.

Relates to fyne-io/fyne#2270

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Oh you are my hero @changkun that patch fixes it 😃

I just sent CL 346150 that does the fix for GOOS in gomobile.

That line only sets the ā€œiosā€ build tag, but not GOOS=ios. This does not enable the GOOS_ios macro in the assembly code. It should set GOOS=ios environment variable. As Go 1.15 is no longer supported we can probably do it unconditionally now.

cc @dmitshur

The error message reads ā€œnon-Go code disabled sigaltstackā€, which means the non-Go code itself disables sigaltstack, not the Go runtime disables it for the non-Go code.

It is true that the Go runtime should not expect sigaltstack being used on iOS, and it is okay that (Go code or non-Go code) disables sigaltstack. But the question is why we get there. What is supposed to happen is that runtime.sigtramp manually switches to the gsignal stack and runtime.adjustSignalStack returns early without getting to the throw later. Why this does not happen?

How is your iOS app built? Does it build with GOOS=ios?

@bcmills I tested CL 344969 for an iOS 15 beta 6 real iPhone device, iOS 13/14/15 simulators, and the issue reported in #35851 did not occur. Would you mind give a small help and trigger a trybot run on CL344969?

Thanks for this @changkun I honestly thought it could have been Fyne related for a while or I would have reported it up here sooner. Also knowing that Go 1.17 exhibits the same problem as 1.16 kicked me to dig deeper.