我正在尝试使用在 Android 模拟器上运行 iOS 应用程序Apportable
我在终端中使用以下命令编译并运行该应用程序
ROOTED=yes MTP=no apportable debug
模拟器使用以下设置进行设置:
使用 Apportable 时,您可以在 xcode 中安装 Android 设备模拟器吗
它编译得很好,但是SIGSEGV
当应用程序在模拟器的启动屏幕上时出现分段错误。当我尝试使用它进行跟踪时,bt
它没有显示任何内容。
我已经尝试在谷歌上搜索有关如何跟踪错误但没有运气的解决方案。
这是来自的输出Terminal
:
Debugging...
1871 KB/s (26836917 bytes in 14.005s)
pkg: /data/local/tmp/Chaser-debug.apk
Success
Starting: Intent { cmp=Cromian.CHASER/com.apportable.activity.VerdeActivity (has extras) }
Failed to load one the Breakpoints files:
/Users/Anders/Documents/Xcode/iOS_code/Cromian/Chaser/chaser_app/Chaser.xcodeproj/xcuserdata/Anders.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
/Users/Anders/Documents/Xcode/iOS_code/Cromian/Chaser/chaser_app/Chaser.xcodeproj/xcuserdata/Anders.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
Attaching to pid 1149
Attached; pid = 1149
Listening on port 5039
657 KB/s (9592 bytes in 0.014s)
GNU gdb (GDB) 7.5-https://github.com/apportable/gdb Jan 3 2014 13:47:56
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin12.4.0 --target=arm-elf-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Remote debugging from host 127.0.0.1
warning: Could not load shared library symbols for gralloc.goldfish.so.
Do you need "set solib-search-path" or "set sysroot"?
libthread_db:td_ta_new: Probing system for platform bug.
libthread_db:td_ta_new: Running as root, nothing to do.
0x40037ebc in epoll_wait ()
from /Users/Anders/.apportable/cache/devices/emulator-5554/libs/libc.so
$1 = 1
$2 = 0
Breakpoint 1 at 0x5cadf2c8: file /Users/Anders/Documents/Xcode/iOS_code/Cromian/Chaser/chaser_app/Chaser/main.m, line 13.
Breakpoint 2 at 0x5a1d8ed0
[New Thread 1169]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1169]
0x40005a1e in ?? ()
(gdb) bt
#0 0x40005a1e in ?? ()
#1 0x400044d2 in ?? ()
#2 0x400044d2 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
如何找到分段错误的原因?
编辑:通过使用命令 x/200a $sp 我能够在分段错误之后获得以下跟踪:
(gdb) x/200a $sp
0x57b7fac0: 0x0 0x0 0x57b7fbe0 0xcb18276c
0x57b7fad0: 0x0 0x0 0x40015964 0x40015a88
0x57b7fae0: 0x40015bac 0x40015cd0 0x40010bd4 0x40011064
0x57b7faf0: 0x40011188 0x400100ac 0x40010cf8 0x40010e1c
0x57b7fb00: 0x40010f40 0x0 0x28 0x0
0x57b7fb10: 0xcb18276c 0xcb18276c 0xcb18276c 0x3f000000
0x57b7fb20: 0x0 0xffffffd1 0x2d0 0x0
0x57b7fb30: 0x4045adcc 0x2a19da10 0x2a187260 0x4045fcb0
0x57b7fb40: 0x404584b8 0x1 0x57b80c6c 0x4003ecbb <snprintf+79>
0x57b7fb50: 0x0 0x0 0x400174c4 0x580ce000
0x57b7fb60: 0x580ce034 0x40003ff9 0x400175c0 0x57b7fc07
0x57b7fb70: 0x0 0xfdc 0xffff0208 0x57b7fbe4
0x57b7fb80: 0xfff 0x26 0x57b7fba8 0x400174c4
0x57b7fb90: 0x0 0x57b7fbe4 0x2a187260 0x4045fcb0
0x57b7fba0: 0x404584b8 0x40003f4b 0x57b7fbe4 0x4000
0x57b7fbb0: 0x3c14001 0x3c10000 0x57b7fbe4 0x4045adcc
0x57b7fbc0: 0x2a19da10 0x400050bf 0x0 0x4044758f
0x57b7fbd0: 0x2a187260 0x5a8ff01c <__CFStrAllocateMutableContents+80> 0x584d1040 0x4006b228 <__stack_chk_guard>
0x57b7fbe0: 0x30025 0x7379732f 0x2f6d6574 0x2f62696c
0x57b7fbf0: 0x2f6c6765 0x4562696c 0x655f4c47 0x616c756d
0x57b7fc00: 0x6e6f6974 0x6f732e 0x0 0x0
0x57b7fc10: 0x0 0x0 0x0 0x0
0x57b7fc20: 0x0 0x20 0x5a86695c <__CFAllocatorSystemAllocate> 0x0
0x57b7fc30: 0x57b7fd08 0x1 0x0 0x5844f640 <arena_malloc+1020>
0x57b7fc40: 0x5b04ae00 0x0 0x1728 0x12
0x57b7fc50: 0x0 0x10 0x20 0x1
0x57b7fc60: 0x57b7fc80 0x58449d48 <__wrap_malloc+240> 0x57b7fc78 0x20
0x57b7fc70: 0x600 0x5d1b9461 0x1 0x5d1b9440
0x57b7fc80: 0x5d1b9460 0x0 0x5d1b9460 0x0
0x57b7fc90: 0x0 0x14 0xcb18276c 0x20
0x57b7fca0: 0x12 0x2 0x57b7fd80 0x1
0x57b7fcb0: 0xa 0x0 0x5a9d2270 <_MergedGlobals+112> 0x7
0x57b7fcc0: 0x0 0x5d1b9581 0xcb18276c 0x5d1b9560
---Type <return> to continue, or q <return> to quit---
0x57b7fcd0: 0x5d1b9580 0x0 0x5d1b9580 0x0
0x57b7fce0: 0x0 0x3 0x0 0x20
0x57b7fcf0: 0x2 0x1 0x57b7fdd0 0x1
0x57b7fd00: 0xa 0x0 0x5a9d2270 <_MergedGlobals+112> 0x57b7fe08
0x57b7fd10: 0x2c78 0x0 0x0 0x57b7fd20
0x57b7fd20: 0x200078c 0x5a1b6860 <OSAtomicCompareAndSwap32+76> 0x5a86695c <__CFAllocatorSystemAllocate> 0x6325
0x57b7fd30: 0x584d11a8 0x7fffffff 0xa 0x4004471b <strtol+163>
0x57b7fd40: 0x5d1b9584 0x57b7fd94 0xa 0x5d1b9583
0x57b7fd50: 0x5d1b9584 0x1 0x5d1a67e0 0x1
0x57b7fd60: 0x584d10d0 0x88 0x5d1a67e0 0x5844f65c <arena_malloc+1048>
0x57b7fd70: 0x584d11a8 0x1 0x584d1040 0x1728
0x57b7fd80: 0x5d1b95e0 0x0 0x584d1358 0x584d1040
0x57b7fd90: 0x0 0x5844f640 <arena_malloc+1020> 0x5d1b3cc4 0x0
0x57b7fda0: 0x1728 0x7c 0x584d1040 0x5a2e64dc <_atomic_lock>
0x57b7fdb0: 0x20348 0x5b00f660 0x584d1040 0x80860000
0x57b7fdc0: 0x20348 0x5b00f660 0x80860000 0x5a1b6860 <OSAtomicCompareAndSwap32+76>
0x57b7fdd0: 0x5cc3a164 <OBJC_CLASS_$_VerdeActivity> 0x5b04ae00 0x5cc3a164 <OBJC_CLASS_$_VerdeActivity> 0x1e