Skip to content

runtime: _rt0_arm_darwin_lib smashes R11 in darwin/arm c-archive entry point #12590

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

Closed
scisci opened this issue Sep 11, 2015 · 27 comments
Closed

Comments

@scisci
Copy link

scisci commented Sep 11, 2015

I've built an ios library. On one developers computer it works fine (mine where I built the library), on another developers build I get this error:

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in main.init from /Users/... To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

And then it crashes immediately.

@hyangah
Copy link
Contributor

hyangah commented Sep 11, 2015

What are the go tool version, and the gomobile version used in your computer, and your coworker's computer?

go version
gomobile version

@scisci
Copy link
Author

scisci commented Sep 11, 2015

go version go1.5 darwin/amd64
gomobile version +9e2ad8c Wed Sep 2 21:16:25 2015 +0000 (android,ios); androidSDK=

Co worker does not use go, so I am building the library and then adding it to a shared xcode project. When I build the project its fine and runs on the device. When he builds the project it gives the PIE error and crashes immediately.

Also tried building like this to address PIE error:
gomobile bind -target=ios -ldflags '-extldflags=-fno-PIC' -v

but it didn't seem to make a difference. I'm not sure if that is the correct way.

@hyangah
Copy link
Contributor

hyangah commented Sep 11, 2015

@crawshaw and @rakyll do you know any trick to get more info about crash?

@scisci
Copy link
Author

scisci commented Sep 11, 2015

A little more info:

All I'm doing is building the library and then adding it to the link binary with libraries phase. I'm not embedding the framework because I get an error while codesigning error:
crmapi.framework: bundle format unrecognized, invalid, or unsuitable

So that is probably the issue. However, the PIE problem could be an issue down the road if we try to submit to Apple.

@rakyll
Copy link
Contributor

rakyll commented Sep 11, 2015

We need to know which clang you use and which SDK you are targeting to in order to reproduce. Could you paste the output of the following commands?

xcrun --sdk iphoneos --find clang
xcrun --sdk iphoneos --show-sdk-version

@rakyll
Copy link
Contributor

rakyll commented Sep 11, 2015

Could you also run the gomobile bind command with the -x option and paste the output here? gomobile bind --target=ios -x

@scisci
Copy link
Author

scisci commented Sep 11, 2015

Does the build process install the library on the local machine? Maybe since I'm building the framework on my machine, my Xcode has access to the library, but when my colleague builds, he doesn't have the library installed since he doesn't have golang or any of the other build files. He just has the .framework file. Does that sound like a possibility?

@rakyll
Copy link
Contributor

rakyll commented Sep 11, 2015

Does the build process install the library on the local machine?

golang bind builds the Go package into a C archive and generates a header file. It packs them both into a .framework bundle. It doesn't install anything to the host machine, everything you need is in the framework bundle and you must be able to distribute it as it is (in your case, you are distributing it to your coworker's machine).

Can you send us any stack traces you can gather from the crash time? There is a possibility that the framework bundle is not properly linked against the app your are building and the app is crashing to the missing symbols. Can you double check the Xcode build steps to see if the framework is included?

@scisci
Copy link
Author

scisci commented Sep 12, 2015

I will check with the guy whose machine is crashing and will know tomorrow (unfortunately we're in different countries so it makes debugging all the more fun).

Just to clarify: Is it sufficient to just include the framework in the 'Link Binary with Libraries' phase, without having to also embed it in the bundle? Traditionally frameworks get linked and then embedded, but on my machine it works without embedding so I'm hoping that is the case.

@rakyll
Copy link
Contributor

rakyll commented Sep 12, 2015

You don't have to embed, you need to link. Embedding allows you to distribute the framework as it is in the app bundle whereas linking is statically linking the library to the final binary.

@scisci
Copy link
Author

scisci commented Sep 13, 2015

Here is the stack trace of the memory error that my colleague receives when running the application on his device. Please note, he is able to run in simulator fine. So the library must be linking to some extent. But then on the device we get this. On my device it works fine. We're both running ios 8.4.1, but I'm on an iPhone 6 and he's on an iPhone 5.
screen shot 2015-09-11 at 19 31 46

I've found some similar stack overflow issues:
http://stackoverflow.com/questions/24690267/exception-break-triggered-by-global-i-a-from-imageloadermachodomodinitfun

It seems this stack trace just indicates that something is going wrong when loading an external library, so it might not be of much help. However, I feel that the warning I referred to, to start this issue is relevant. It seems gomobile isn't building Position-Independent code which is required for ios apps. Whether that is what is causing the crash or not, it should be addressed.

@scisci
Copy link
Author

scisci commented Sep 13, 2015

Another piece of the puzzle:

he's compiling with -arch armv7
I'm compiling with -arch arm64

@scisci
Copy link
Author

scisci commented Sep 13, 2015

I've verified that this is armv7 specific since it works on my own iphone6 but crashes and has multiple warnings for iphone 5:

Warning 1:
ld: warning: Auto-Linking supplied '/Users/danielriley/Documents/XCode/verisart-iphone-app/InternalFrameworks/Crmapi.framework/Crmapi', framework linker option at /Users/danielriley/Documents/XCode/iphone-app/InternalFrameworks/Crmapi.framework/Crmapi is not a dylib

Warning 2:
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in main.init from /Users/danielriley/Documents/XCode/iphone-app/InternalFrameworks/crmapi.framework/crmapi(go.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

Crash comes at:
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&)

which based on some other questions seems to be related static initializers, but I don't know about that.

the dump from gomobile bind -target=ios -x

GOMOBILE=/Users/danielriley/documents/go/pkg/gomobile
WORK=/var/folders/mr/3xqmfb0d2cxcck1vlkrj4fp80000gn/T/gomobile-work-535969706
mkdir -p $WORK/src/go_crmapi
gobind -lang=go -outdir=$WORK/src/go_crmapi github.com/verisart/cidoccrm/crmapi
mkdir -p $WORK/src/iosbin
mkdir -p $WORK/objc
gobind -lang=objc -outdir=$WORK/objc github.com/verisart/cidoccrm/crmapi
mkdir -p $WORK/objc
cp $GOPATH/src/golang.org/x/mobile/bind/objc/seq.h $WORK/objc/seq.h
mkdir -p $WORK/objc
GOOS=darwin GOARCH=arm GOARM=7 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch armv7 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch armv7 CGO_ENABLED=1 go build -p=2 -pkgdir=$GOMOBILE/pkg_darwin_arm -tags="" -x -buildmode=c-archive -tags=ios -o $WORK/crmapi-arm.a $WORK/src/iosbin/main.go
PWD=$WORK/objc GOOS=darwin GOARCH=arm GOARM=7 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch armv7 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch armv7 CGO_ENABLED=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -I . -g -O2 -o gobind-crmapi-arm.o -c GoCrmapi.m -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch armv7
PWD=$WORK/objc ar -q -s $WORK/crmapi-arm.a gobind-crmapi-arm.o
GOOS=darwin GOARCH=arm64 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch arm64 CGO_ENABLED=1 go build -p=2 -pkgdir=$GOMOBILE/pkg_darwin_arm64 -tags="" -x -buildmode=c-archive -tags=ios -o $WORK/crmapi-arm64.a $WORK/src/iosbin/main.go
PWD=$WORK/objc GOOS=darwin GOARCH=arm64 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch arm64 CGO_ENABLED=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -I . -g -O2 -o gobind-crmapi-arm64.o -c GoCrmapi.m -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -arch arm64
PWD=$WORK/objc ar -q -s $WORK/crmapi-arm64.a gobind-crmapi-arm64.o
GOOS=darwin GOARCH=amd64 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -mios-simulator-version-min=6.1 -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -mios-simulator-version-min=6.1 -arch x86_64 CGO_ENABLED=1 go build -p=2 -pkgdir=$GOMOBILE/pkg_darwin_amd64 -tags="" -x -buildmode=c-archive -tags=ios -o $WORK/crmapi-amd64.a $WORK/src/iosbin/main.go
PWD=$WORK/objc GOOS=darwin GOARCH=amd64 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -mios-simulator-version-min=6.1 -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -mios-simulator-version-min=6.1 -arch x86_64 CGO_ENABLED=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -I . -g -O2 -o gobind-crmapi-amd64.o -c GoCrmapi.m -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -mios-simulator-version-min=6.1 -arch x86_64
PWD=$WORK/objc ar -q -s $WORK/crmapi-amd64.a gobind-crmapi-amd64.o
rm -r -f "crmapi.framework"
mkdir -p crmapi.framework/Versions/A/Headers
ln -s A crmapi.framework/Versions/Current
ln -s Versions/Current/Headers crmapi.framework/Headers
ln -s Versions/Current/Crmapi crmapi.framework/Crmapi
xcrun lipo -create -arch armv7 $WORK/crmapi-arm.a -arch arm64 $WORK/crmapi-arm64.a -arch x86_64 $WORK/crmapi-amd64.a -o crmapi.framework/Versions/A/Crmapi
cp $WORK/objc/GoCrmapi.h crmapi.framework/Versions/A/Headers/Crmapi.h
mkdir -p crmapi.framework/Versions/A/Headers
rm -r -f "$WORK"

@hyangah
Copy link
Contributor

hyangah commented Sep 13, 2015

Thank you very much for all the hard work.

FYI, I filed #12604 and we will fix the problem.

I don't have iphone5 device. When using the iphone5 simulator & framework, I couldn't reproduce the first warning. Is the crash reproducible with iphone5?

Since your build set up is different, I want to check if that's the build set up difference, or simulator vs. real device. It's a static framework, and xcode error message about dylib looks suspicious.

BTW, the PIE warning didn't stop us from our Ivy app release. But our Ivy app release was done before we decide to let gomobile bind generate frameworks. :-(

@scisci
Copy link
Author

scisci commented Sep 13, 2015

Hi @hyangah, I was able to get rid of the dylib warning by linking against the archive itself (within the .framework folder) rather than the framework. If you attempt to add a framework, the path gets added to xcode's framework search paths which I guess it assumes are dynamic.. which causes the dylib warning. Don't think that was contributing to the crash. I linked directly against the static library and it went away.

The crash is 100% reproducible on iphone5. If I remove the library linkage app runs fine, if I add it in it gets the crash at the below mentioned area. I appreciate the help.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xe5171008
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   ???                             0xe5171008 0 + -451473400
1   dyld                            0x1fe19c1c ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 20
2   dyld                            0x1fe17004 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 352
3   dyld                            0x1fe16e5a ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 106
4   dyld                            0x1fe17130 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 52
5   dyld                            0x1fe0ce40 dyld::initializeMainExecutable() + 164
6   dyld                            0x1fe1043e dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2722
7   dyld                            0x1fe0c226 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 398
8   dyld                            0x1fe0c040 _dyld_start + 64

Thread 1:
0   dyld                            0x1fe1ddcc ImageLoaderMachOCompressed::trieWalk(unsigned char const*, unsigned char const*, char const*) + 180
1   dyld                            0x1fe1ded4 ImageLoaderMachOCompressed::findExportedSymbol(char const*, ImageLoader const**) const + 64
2   dyld                            0x1fe19268 ImageLoaderMachO::findExportedSymbol(char const*, bool, ImageLoader const**) const + 28
3   dyld                            0x1fe19268 ImageLoaderMachO::findExportedSymbol(char const*, bool, ImageLoader const**) const + 28
4   dyld                            0x1fe1e5d0 ImageLoaderMachOCompressed::resolveTwolevel(ImageLoader::LinkContext const&, ImageLoader const*, bool, char const*, bool, ImageLoader const**) + 48
5   dyld                            0x1fe1e798 ImageLoaderMachOCompressed::resolve(ImageLoader::LinkContext const&, char const*, unsigned char, long, ImageLoader const**, ImageLoaderMachOCompressed::LastLookup*, bool) + 212
6   dyld                            0x1fe1fcb2 ImageLoaderMachOCompressed::doBindFastLazySymbol(unsigned int, ImageLoader::LinkContext const&, void (*)(), void (*)()) + 154
7   dyld                            0x1fe0ea92 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 142
8   libdyld.dylib                   0x34661090 dyld_stub_binder + 16
9   libBacktraceRecording.dylib     0x008fe7d8 0x8fc000 + 10200
10  libsystem_pthread.dylib         0x347a6e0a _pthread_body + 126
11  libsystem_pthread.dylib         0x347a6d86 _pthread_start + 114
12  libsystem_pthread.dylib         0x347a4b10 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x0063f80c    r1: 0x003c9215      r2: 0xe5171008      r3: 0x00001000
    r4: 0x000a9d58    r5: 0x1fe2f988      r6: 0x003c9215      r7: 0x008f9718
    r8: 0x00000002    r9: 0x370a99dc     r10: 0x00000003     r11: 0x0063f80c
    ip: 0x370a9120    sp: 0x008f96e0      lr: 0x1fe19aef      pc: 0xe5171008
  cpsr: 0x80000010

@scisci
Copy link
Author

scisci commented Sep 14, 2015

Has anyone been able to compile a library for armv7/iphone5 (actual device, not simulator)? Just wondering if I should keep looking into fixes for this or if its some bug deeper in. I'd be happy to do tests on my iphone5 to verify.

@crawshaw
Copy link
Member

This definitely worked at some point recently, when we shipped the first version of Ivy the armv7 .a file worked. It looks like you're using the released version of Go 1.5, is that correct?

I have a device here we can try it on (an armv7 iPad). I'll give it a go in the next couple of days. It looks like from your stack trace that the program is failing very early in the runtime initialization. However just to be sure, you may want to try compiling with -tags=lldb, which will enable a signal handler that may provide more information.

@scisci
Copy link
Author

scisci commented Sep 14, 2015

Will do, I will also try to just build the example project as a base test.

@scisci
Copy link
Author

scisci commented Sep 14, 2015

Hi @crawshaw, @hyangah @rakyll , I found the root of the crash! It seems to be triggered by any publicly declared interface. I came up with the most minimal test below (which causes a crash):

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package hello is a trivial package for gomobile bind example.
package hello

import "fmt"

type TestInterface interface {
}

func Greetings(name string) string {
    return fmt.Sprintf("Greetings, %s!", name)
}

If I change the interface to a struct, no crash. So please be aware of this issue and see if you can push a fix through. I am able to change my code to simply not use interfaces and will just use structs.

@crawshaw
Copy link
Member

Great detective work @scisci. Without a machine to test, I see two ways this could happen.

The first and most likely is that the global constructor go_seq_very_init in bind/objc/seq_darwin.m is not being called before the global constructor declared in the generated code. I believe these are compiled as separate translation units and so running in the wrong order is entirely possible. (The call order of global constructors is undefined across translation units.)

The second possibility is that I believe capturing blocks are saved to stack memory, and only heap allocated on request.

I wrote a speculative cl/14549, and will test it out tomorrow.

@gopherbot
Copy link
Contributor

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

crawshaw added a commit to golang/mobile that referenced this issue Sep 15, 2015

Verified

This commit was signed with the committer’s verified signature.
bagder Daniel Stenberg
A framework generated with gomobile bind -target=ios has two global
constructors: one initializing a data structure and another using it.
These constructors are defined in different translation units, which
(I believe, reasoning from C++ global constructors) means their order
of initialization is undefined.

A capturing block is stack allocated. Its memory is invalid after the
function returns. Make a copy of the interface initializer blocks so
they can be saved to the heap.

Block implementation background:
http://www.cocoawithlove.com/2009/10/how-blocks-are-implemented-and.html

Updates golang/go#12590

Change-Id: Ia7ae9f4bbd8df6e6e79949de54b3e6c48148c700
Reviewed-on: https://go-review.googlesource.com/14549
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@crawshaw crawshaw changed the title x/mobile/bind ios PIE disabled warning runtime: darwin/arm c-archive entry point fails if extra global constructors are present Sep 15, 2015
@crawshaw crawshaw added this to the Go1.5.2 milestone Sep 15, 2015
@crawshaw crawshaw self-assigned this Sep 15, 2015
@gopherbot
Copy link
Contributor

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

@scisci
Copy link
Author

scisci commented Oct 15, 2015

hi @crawshaw. What would I need to do to be able to test this? Would I have to update Go to tip, or gomobile?

@rakyll
Copy link
Contributor

rakyll commented Oct 15, 2015

@scisci, you need to update Go to the tip.

@rsc rsc changed the title runtime: darwin/arm c-archive entry point fails if extra global constructors are present runtime: _rt0_arm_darwin_lib smashes R11 in darwin/arm c-archive entry point Nov 13, 2015
@gopherbot
Copy link
Contributor

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

crawshaw added a commit that referenced this issue Nov 17, 2015
The _rt0_arm_darwin_lib entrypoint has to conform to the darwin ARMv7
calling convention, which requires functions to preserve the value of
R11. Go uses R11 as the liblink REGTMP register, so save it manually.

Also avoid using R4, which is also callee-save.

Fixes #12590

Change-Id: I9c3b374e330f81ff8fc9c01fa20505a33ddcf39a
Reviewed-on: https://go-review.googlesource.com/14603
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/16968
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
@gopherbot
Copy link
Contributor

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

gopherbot pushed a commit that referenced this issue Mar 15, 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>
@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 14, 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