How to test on darwin_arm64 machine?

626 views
Skip to first unread message

Wei....@arm.com

unread,
Aug 18, 2017, 2:29:45 AM8/18/17
to golang-dev
I'm enabling framepointer for arm64 port and the work is almost done for linux os.
But I don't have access to darwin_arm64 and can't test and debug the patch on darwin os.
I only have an iPad with arm64 cpu but it's hard for me to get even a shell terminal from it.
Can anyone provide me some suggestions or help?

elias...@gmail.com

unread,
Aug 19, 2017, 10:01:20 AM8/19/17
to golang-dev
Hi,

I don't think it's possible to get a shell from an iOS device.

The best way I know of is to run the standard Go tests with iostest.bash. Running GOARCH=arm64 GOOS=darwin go run <go-file> should also work; go uses the exec wrapper in misc/ios/go_darwin_arm_exec.go to sign the binary, copy it to the device and run it through lldb.

iostest.bash and go run need various environment variables that points to your signing provisioning profile. Run misc/ios/detect.go to fetch a set of good values. If you don't have a provisioning profile, running anything from Xcode on your iOS device should set up a profile based on your apple developer account.

Running stuff on iOS is so awful; I'm sorry.

 - elias

steeve...@gmail.com

unread,
Aug 20, 2017, 12:57:36 AM8/20/17
to golang-dev
Awesome work!

However, to obtain a shell, you'll need to jailbreak the device.
I do have one if you want me to test something.

Steeve

steeve...@gmail.com

unread,
Aug 20, 2017, 12:57:36 AM8/20/17
to golang-dev
You will need a jailbroken device to get shell access.

I do have one handy, so I can test stuff if you want.


On Friday, August 18, 2017 at 8:29:45 AM UTC+2, Wei....@arm.com wrote:

aubsquarcoo

unread,
Aug 20, 2017, 11:40:24 PM8/20/17
to steeve...@gmail.com, golang-dev




Sent from my T-Mobile 4G LTE Device

-------- Original message --------
Date: 8/19/17 15:01 (GMT-06:00)
To: golang-dev <golan...@googlegroups.com>
Subject: [golang-dev] Re: How to test on darwin_arm64 machine?

You will need a jailbroken device to get shell access.

I do have one handy, so I can test stuff if you want.

On Friday, August 18, 2017 at 8:29:45 AM UTC+2, a2Wei....@arm.com wrote:
I'm enabling framepointer for arm64 port and the wozfc csc zrk is almost done for linux os.
But I don't have access to darwin_arm64 and can't test and debug the patch on darwin os.
I only have an iPad with arm64 cpu but it's hard for me to get even a shell terminal from it.
Can anyone provide me some suggestions or help?

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit E, awz,htandtps:,s//groups.google.com/d/optout.

Wei....@arm.com

unread,
Sep 5, 2017, 6:06:51 AM9/5/17
to golang-dev
Hi Steeve,

Could you please help me test the patch: https://go-review.googlesource.com/c/go/+/61511 on darwin_arm64?
I need the log if it crashes.

Thanks
Wei Xiao

steeve...@gmail.com

unread,
Nov 13, 2017, 7:28:23 PM11/13/17
to golang-dev
I'm late to the party but I just tested your CL (from Oct 20th).
Unfortunately it doesn't work, the stack traces are wrong, both in case of a Panic and in case of a nil pointer.

For instance:
# Crashlytics - plaintext stacktrace downloaded by Steeve Morin at Tue, 14 Nov 2017 00:27:19 GMT
# Platform: ios
# Application: testapp-swift
# Version: 1.0 (1)
# Issue #: 2
# Issue ID: 591c99d0be077a4dccdaf367
# Session ID: 5a402e3c98264061900ece2494bd61b6_72788d9ac8d211e78fd856847afe9799_0_v2
# Date: 2017-11-14T00:26:00Z
# OS Version: 11.1.1 (15B150)
# Device: iPhone X
# RAM Free: 6.8%
# Disk Free: 69.1%

#0. Crashed: com.apple.main-thread
0  testapp-swift                  0x1046b9578 runtime.raiseproc + 24
1  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
2  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
3  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
4  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
5  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
6  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
7  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
8  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
9  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
10 testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64

--

#0. Crashed: com.apple.main-thread
0  testapp-swift                  0x1046b9578 runtime.raiseproc + 24
1  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
2  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
3  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
4  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
5  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
6  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
7  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
8  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
9  testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64
10 testapp-swift                  0x1046a5aa0 runtime.dieFromSignal + 64

#1. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#2. Thread
0  libsystem_kernel.dylib         0x183c65dbc __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x183d76fa0 _pthread_wqthread + 884
2  libsystem_pthread.dylib        0x183d76c20 start_wqthread + 4

#3. Thread
0  libsystem_kernel.dylib         0x183c65dbc __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x183d76fa0 _pthread_wqthread + 884
2  libsystem_pthread.dylib        0x183d76c20 start_wqthread + 4

#4. Thread
0  libsystem_kernel.dylib         0x183c65dbc __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x183d76fa0 _pthread_wqthread + 884
2  libsystem_pthread.dylib        0x183d76c20 start_wqthread + 4

#5. Thread
0  libsystem_kernel.dylib         0x183c65dbc __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x183d77134 _pthread_wqthread + 1288
2  libsystem_pthread.dylib        0x183d76c20 start_wqthread + 4

#6. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x183c44bc4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183c44a3c mach_msg + 72
2  CoreFoundation                 0x1840f5c74 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x1840f3840 __CFRunLoopRun + 1424
4  CoreFoundation                 0x184013fb8 CFRunLoopRunSpecific + 436
5  Foundation                     0x184a3d6e4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6  Foundation                     0x184a5cafc -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7  UIKit                          0x18e1472f4 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x184b3e860 __NSThread__start__ + 996
9  libsystem_pthread.dylib        0x183d7831c _pthread_body + 308
10 libsystem_pthread.dylib        0x183d781e8 _pthread_body + 310
11 libsystem_pthread.dylib        0x183d76c28 thread_start + 4

#7. Thread
0  libsystem_kernel.dylib         0x183c65dbc __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x183d77134 _pthread_wqthread + 1288
2  libsystem_pthread.dylib        0x183d76c20 start_wqthread + 4

#8. Thread
0  testapp-swift                  0x1046b9934 runtime.mach_semaphore_timedwait + 20
1  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
2  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
3  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
4  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
5  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
6  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
7  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
8  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
9  testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196
10 testapp-swift                  0x10468fdd4 runtime.semasleep1 + 196

#9. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#10. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#11. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#12. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#13. Thread
0  testapp-swift                  0x1046b990c runtime.mach_semaphore_wait + 12
1  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
2  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
3  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
4  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
5  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
6  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
7  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
8  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
9  testapp-swift                  0x10468fd50 runtime.semasleep1 + 64
10 testapp-swift                  0x10468fd50 runtime.semasleep1 + 64

#14. com.twitter.crashlytics.ios.MachExceptionServer
0  libsystem_kernel.dylib         0x183c44bc4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183c44a3c mach_msg + 72
2  testapp-swift                  0x1046fcaa4 CLSMachExceptionServer + 100
3  libsystem_pthread.dylib        0x183d7831c _pthread_body + 308
4  libsystem_pthread.dylib        0x183d781e8 _pthread_body + 310
5  libsystem_pthread.dylib        0x183d76c28 thread_start + 4

#15. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x183c44bc4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x183c44a3c mach_msg + 72
2  CoreFoundation                 0x1840f5c74 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x1840f3840 __CFRunLoopRun + 1424
4  CoreFoundation                 0x184013fb8 CFRunLoopRunSpecific + 436
5  CFNetwork                      0x18477e264 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6  Foundation                     0x184b3e860 __NSThread__start__ + 996
7  libsystem_pthread.dylib        0x183d7831c _pthread_body + 308
8  libsystem_pthread.dylib        0x183d781e8 _pthread_body + 310
9  libsystem_pthread.dylib        0x183d76c28 thread_start + 4

Steeve Morin

unread,
Nov 14, 2017, 12:25:03 PM11/14/17
to golang-dev
@wei:

--
You received this message because you are subscribed to a topic in the Google Groups "golang-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-dev/v1TxCJNemPY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Wei....@arm.com

unread,
Nov 19, 2017, 6:26:25 AM11/19/17
to golang-dev
Ok, i will have a look.

Wei....@arm.com

unread,
Apr 13, 2018, 6:34:04 AM4/13/18
to golang-dev
hi, can you try the latest version of my patch (https://go-review.googlesource.com/c/go/+/61511) on darwin/arm64?

Thanks
Wei Xiao

On Wednesday, November 15, 2017 at 1:25:03 AM UTC+8, Steeve Morin wrote:

elias...@gmail.com

unread,
Apr 13, 2018, 1:49:02 PM4/13/18
to golang-dev
Hi,

I ran the golang.org/x/mobile/example/bind/hello/ios example, with this change:

diff --git a/example/bind/hello/hello.go b/example/bind/hello/hello.go
index 2d98ff9..aa25bd3 100644
--- a/example/bind/hello/hello.go
+++ b/example/bind/hello/hello.go
@@ -8,5 +8,11 @@ package hello
 import "fmt"
 
 func Greetings(name string) string {
+       crash();
        return fmt.Sprintf("Hello, %s!", name)
 }
+
+func crash() {
+       var i *int
+       *i = 0
+}

On the darwin/amd64 emulator, the Xcode displayed a good stack trace and pointed at the exact line the program crashed:


On the iPhone 5S, the trace is cut off:


its the same with or without your CL.

If it's any help, if I run the gomobile example after building with -ldflags="-w", the stack trace on the darwin/amd64 emulator regress and look the same as on the iPhone 5S.

Steeve Morin

unread,
Apr 14, 2018, 1:02:20 PM4/14/18
to elias...@gmail.com, golang-dev
@elias
In the case of darwin/amd64, I think what's helping is DWARF, which weirdly is not helping on arm64.
Reply all
Reply to author
Forward
0 new messages