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

misc/ios: possible lldb io processing bug in go_darwin_arm_exec #10205

Closed
crawshaw opened this issue Mar 20, 2015 · 5 comments
Closed

misc/ios: possible lldb io processing bug in go_darwin_arm_exec #10205

crawshaw opened this issue Mar 20, 2015 · 5 comments
Milestone

Comments

@crawshaw
Copy link
Member

Appears sporadically on the builder:

 breakpoint set -n getwd
run
Breakpoint 1: where = libsystem_c.dylib`getwd, address = 0x2f7f7294
(lldb) success
(lldb) Process 22484 stopped
* thread #1: tid = 0xfd6a7, 0x1fedf000 dyld`_dyld_start
    frame #0: 0x1fedf000 dyld`_dyld_start
dyld`_dyld_start:
-> 0x1fedf000:  stmibge pc, {r0, r2, r3, r4, r5, r7, r12, sp}
   0x1fedf004:  bhs    0x20b66f44
   0x1fedf008:  sbcseq r0, r1, r10, lsl r12
   0x1fedf00c:  andeq  r0, r0, r0
(lldb) go_darwin_arm_exec: failed (stage br getwd): <nil>
FAIL    crypto/x509 45.722s
@crawshaw crawshaw self-assigned this Mar 20, 2015
@crawshaw crawshaw added this to the Go1.5 milestone Mar 20, 2015
@crawshaw
Copy link
Member Author

"failed" means the process on the iOS device died. I have a very similar failure here:

Breakpoint 1: where = libsystem_c.dylib`getwd, address = 0x2f7f7294
(lldb) success
(lldb) Process 54969 stopped
* thread #1: tid = 0x21b6b6, 0x1febb000 dyld`_dyld_start
    frame #0: 0x1febb000 dyld`_dyld_start
dyld`_dyld_start:
-> 0x1febb000:  svcne  #0xcea98f
   0x1febb004:  .long  0x0c1a2a32                ; unknown opcode
   0x1febb008:  .long  0x000000d1                ; unknown opcode
   0x1febb00c:  andeq  r0, r0, r0
(lldb) go_darwin_arm_exec: failed (stage br getwd): <nil>
FAIL    go/printer  49.412s

where importantly the timeout was 4m:

go_darwin_arm_exec: script -q -t 0 /dev/null ios-deploy --debug -u -r -n --args=-test.short=true -test.timeout=4m0s --bundle /var/folders/2g/gfk3yj9d4318d1x3j8jgkjjw0000gn/T/go_darwin_arm_exec_211943220/gotest.app
go_darwin_arm_exec: parseTimeout of [-test.timeout=4m0s], got 4m0s

So it is entirely possible this is the process randomly dying on its own, but given the predictable state, the similar timing of each failure (46s and 49s), and the fact that the timeouts were far beyond that, I suspect this is the app being killed by iOS app launch timeout.

This means the brTimeout I set in golang.org/cl/8080 may be far too long.

@crawshaw
Copy link
Member Author

Not fixed yet:

go_darwin_arm_exec: timed out on stage br getwd, continuing
 breakpoint delete 1
expr char* $mem = (char*)malloc(512)
go_darwin_arm_exec: timeout (stage prompt after "expr char* $mem = (char*)malloc(512)")
FAIL    sync/atomic 239.252s

@crawshaw
Copy link
Member Author

At this point, I suspect ios-deploy is buffering output somewhere:

go_darwin_arm_exec: timed out on stage br getwd, continuing
--- go_darwin_arm_exec clear ---
 breakpoint set -n getwd
run
Breakpoint 1: where = libsystem_c.dylib`getwd, address = 0x2f7f7294
(lldb)
--- go_darwin_arm_exec clear ---
--- go_darwin_arm_exec clear ---
 Process 3618 stopped
* thread #1: tid = 0x19506, 0x1fe5f000 dyld`_dyld_start, stop reason = signal SIGSTOP
    frame #0: 0x1fe5f000 dyld`_dyld_start
dyld`_dyld_start:
-> 0x1fe5f000:  mov    r8, sp
   0x1fe5f004:  sub    sp, sp, #0x10
   0x1fe5f008:  bic    sp, sp, #0x7
   0x1fe5f00c:  ldr    r3, [pc, #112]            ; _dyld_start + 132
(lldb)
--- go_darwin_arm_exec clear ---
 breakpoint delete 1
expr char* $mem = (char*)malloc(512)
go_darwin_arm_exec: timeout (stage prompt after "expr char* $mem = (char*)malloc(512)")
FAIL    cmd/internal/rsc.io/x86/x86asm  239.249s

@crawshaw
Copy link
Member Author

A related but not exactly the same problem: after about 500 app installs the device becomes very slow. I have idevicediagnostics working from libimobiledevice.org, which lets me reboot devices, which I'll add to the test process somehow.

So far I have been impressed by this software and I'm considering switching from ios-deploy to ideviceinstaller, but I fear it will be a large amount of work.

@crawshaw
Copy link
Member Author

crawshaw commented May 4, 2015

Fixed by a series of CLs in misc/ios/go_darwin_arm_exec.go.

@crawshaw crawshaw closed this as completed May 4, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
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

2 participants