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/cmd/gomobile: iOS app built with gomobile-build fails to run on simulators #25148

Closed
hajimehoshi opened this issue Apr 28, 2018 · 3 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Milestone

Comments

@hajimehoshi
Copy link
Member

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

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hajimehoshi/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hajimehoshi/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/go-build916245002=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Run gomobile build -target=ios -bundleid=com.hajimehoshi.gomobiletest -work golang.org/x/mobile/example/basic
  2. Open the generated main.xcodeproj
  3. Run it on any emulators

What did you expect to see?

The app runs on the emulator

What did you see instead?

SIGABRT

dyld`__abort_with_payload:
    0x58101e0 <+0>:  movl   $0x2000209, %eax          ; imm = 0x2000209 
    0x58101e5 <+5>:  movq   %rcx, %r10
    0x58101e8 <+8>:  syscall 
->  0x58101ea <+10>: jae    0x58101f4                 ; <+20>
    0x58101ec <+12>: movq   %rax, %rdi
    0x58101ef <+15>: jmp    0x580fa48                 ; cerror_nocancel
    0x58101f4 <+20>: retq   
    0x58101f5 <+21>: nop    
    0x58101f6 <+22>: nop    
    0x58101f7 <+23>: nop   
@gopherbot gopherbot added this to the Unreleased milestone Apr 28, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 28, 2018
@hajimehoshi
Copy link
Member Author

CC @eliasnaur

@gopherbot
Copy link

Change https://golang.org/cl/110059 mentions this issue: cmd/gomobile: disable DWARF in gomobile builds

@gopherbot
Copy link

Change https://golang.org/cl/111275 mentions this issue: cmd/link/internal/ld: skip DWARF combining for iOS binaries

gopherbot pushed a commit that referenced this issue May 4, 2018
The macOS and iOS external linker strips DWARF information from
binaries because it assumes the information will go into separate
DWARF information .dSYM files. To preserve the embedded debugging
information, the Go linker re-combines the separate DWARF
information into the unmapped __DWARF segment of the final
executable.

However, the iOS dyld linker does not allow unmapped segments, so
use the presence of the LC_VERSION_MIN_IPHONEOS linker command to
skip DWARF combining. Note that we can't use GOARCH for detection
since the iOS emulator runs on  GOARCH=386 and GOARCH=amd64 and we
will run into https://golang.org/issues/25148.

Updates #25148.

Change-Id: I29a1bc468fdee74ab3b27c46931501a0a8120c66
Reviewed-on: https://go-review.googlesource.com/111275
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
@golang golang locked and limited conversation to collaborators May 3, 2019
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
DWARF doesn't work for buildmode exe binaries; see
golang.org/issues/25148.

Fixes golang/go#25148.

Change-Id: I511599f3d1963ff0b3e48ac5c8cce50ee6aa54de
Reviewed-on: https://go-review.googlesource.com/110059
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
DWARF doesn't work for buildmode exe binaries; see
golang.org/issues/25148.

Fixes golang/go#25148.

Change-Id: I511599f3d1963ff0b3e48ac5c8cce50ee6aa54de
Reviewed-on: https://go-review.googlesource.com/110059
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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
Projects
None yet
Development

No branches or pull requests

2 participants