因此,当我启动我的应用时,我有时会得到一个EXC_BREAKPOINT
或EXC_BAD_ACCESS
指向未被调用的函数中的一行。在编写了一些新的,不相关的代码之后,我可以毫不失败地获得这些崩溃。当我撤消该代码时,我有时可以摆脱错误。但是该代码并不是完全相关的,而且我不确定为什么我会在函数中得到这些错误#39甚至被召唤。
我有一个UIWindow
,其中包含我在发布时返回的自定义VideoPlayer
课程。失败的功能在那个类中,尽管它永远不会被调用。以下是我的表现:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let player = VideoPlayer(frame:UIScreen.mainScreen().bounds)
var window: UIWindow? {
set {
}
get {
return player
}
}
}
堆栈追踪:
libswiftCore.dylib`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> ():
0x1007cc740 <+0>: stp x29, x30, [sp, #-16]!
0x1007cc744 <+4>: mov x29, sp
0x1007cc748 <+8>: sub sp, sp, #16
0x1007cc74c <+12>: and w8, w2, #0x1
0x1007cc750 <+16>: tbnz w8, #0, 0x1007cc770 ; <+48>
0x1007cc754 <+20>: tbnz x1, #63, 0x1007cc7b4 ; <+116>
0x1007cc758 <+24>: add x1, x0, x1
0x1007cc75c <+28>: mov x2, x3
0x1007cc760 <+32>: mov x3, x4
0x1007cc764 <+36>: mov x4, x5
0x1007cc768 <+40>: bl 0x10080edd0 ; function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded> of Swift.(_fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> ()).(closure #2)
-> 0x1007cc76c <+44>: brk #0x1
0x1007cc770 <+48>: str xzr, [sp, #8]
0x1007cc774 <+52>: cmp x0, w0, uxtw
0x1007cc778 <+56>: b.ne 0x1007cc94c ; <+524>
0x1007cc77c <+60>: lsr w8, w0, #11
0x1007cc780 <+64>: cmp w8, #26
0x1007cc784 <+68>: b.hi 0x1007cc7d8 ; <+152>
0x1007cc788 <+72>: cmp w0, #128
0x1007cc78c <+76>: b.lo 0x1007cc808 ; <+200>
0x1007cc790 <+80>: orr w8, wzr, #0x80
0x1007cc794 <+84>: bfxil x8, x0, #0, #6
0x1007cc798 <+88>: cmp w0, #2048
0x1007cc79c <+92>: b.hs 0x1007cc83c ; <+252>
0x1007cc7a0 <+96>: movz x10, #0
0x1007cc7a4 <+100>: movz x11, #0
0x1007cc7a8 <+104>: lsr w9, w0, #6
0x1007cc7ac <+108>: orr w9, w9, #0xffffffc0
0x1007cc7b0 <+112>: b 0x1007cc86c ; <+300>
0x1007cc7b4 <+116>: adr x0, #808224 ; "fatal error"
0x1007cc7b8 <+120>: nop
0x1007cc7bc <+124>: adr x3, #808724 ; "UnsafeBufferPointer with negative count"
0x1007cc7c0 <+128>: nop
0x1007cc7c4 <+132>: movz w1, #0xb
0x1007cc7c8 <+136>: orr w2, wzr, #0x2
0x1007cc7cc <+140>: movz w4, #0x27
0x1007cc7d0 <+144>: orr w5, wzr, #0x2
0x1007cc7d4 <+148>: bl 0x1007cc740 ; <+0>
0x1007cc7d8 <+152>: cmp w0, #14, lsl #12
0x1007cc7dc <+156>: b.lo 0x1007cc818 ; <+216>
0x1007cc7e0 <+160>: cmp w0, #272, lsl #12
0x1007cc7e4 <+164>: b.hs 0x1007cc900 ; <+448>
0x1007cc7e8 <+168>: orr w8, wzr, #0x80
0x1007cc7ec <+172>: bfxil x8, x0, #0, #6
0x1007cc7f0 <+176>: orr w9, wzr, #0xffffff80
0x1007cc7f4 <+180>: bfxil w9, w0, #6, #6
0x1007cc7f8 <+184>: lsr w10, w0, #16
0x1007cc7fc <+188>: cbnz w10, 0x1007cc924 ; <+484>
0x1007cc800 <+192>: lsr w10, w0, #12
0x1007cc804 <+196>: b 0x1007cc848 ; <+264>
0x1007cc808 <+200>: movz x9, #0
0x1007cc80c <+204>: movz x11, #0
0x1007cc810 <+208>: mov x8, x0
0x1007cc814 <+212>: b 0x1007cc89c ; <+348>
0x1007cc818 <+216>: adr x0, #808124 ; "fatal error"
0x1007cc81c <+220>: nop
0x1007cc820 <+224>: adr x3, #811328 ; "high- and low-surrogate code points are not valid Unicode scalar values"
0x1007cc824 <+228>: nop
0x1007cc828 <+232>: movz w1, #0xb
0x1007cc82c <+236>: orr w2, wzr, #0x2
0x1007cc830 <+240>: movz w4, #0x47
0x1007cc834 <+244>: orr w5, wzr, #0x2
0x1007cc838 <+248>: bl 0x1007cc740 ; <+0>
0x1007cc83c <+252>: lsr w10, w0, #12
0x1007cc840 <+256>: orr w9, wzr, #0xffffff80
0x1007cc844 <+260>: bfxil w9, w0, #6, #6
0x1007cc848 <+264>: movz x12, #0
0x1007cc84c <+268>: movz x11, #0
0x1007cc850 <+272>: orr w10, w10, #0xffffffe0
0x1007cc854 <+276>: and x10, x10, #0xff
0x1007cc858 <+280>: lsl x13, x12, #3
0x1007cc85c <+284>: lsl x10, x10, x13
0x1007cc860 <+288>: orr x11, x10, x11
0x1007cc864 <+292>: str x11, [sp, #8]
0x1007cc868 <+296>: add x10, x12, #1
0x1007cc86c <+300>: orr w12, wzr, #0x8
0x1007cc870 <+304>: umulh x12, x10, x12
0x1007cc874 <+308>: cmp xzr, x12
0x1007cc878 <+312>: b.ne 0x1007cc94c ; <+524>
0x1007cc87c <+316>: lsl x12, x10, #3
0x1007cc880 <+320>: cmp x12, #63
0x1007cc884 <+324>: b.hi 0x1007cc8dc ; <+412>
0x1007cc888 <+328>: and x9, x9, #0xff
0x1007cc88c <+332>: lsl x9, x9, x12
0x1007cc890 <+336>: orr x11, x9, x11
0x1007cc894 <+340>: str x11, [sp, #8]
0x1007cc898 <+344>: add x9, x10, #1
0x1007cc89c <+348>: orr w10, wzr, #0x8
0x1007cc8a0 <+352>: umulh x10, x9, x10
0x1007cc8a4 <+356>: cmp xzr, x10
0x1007cc8a8 <+360>: b.ne 0x1007cc94c ; <+524>
0x1007cc8ac <+364>: lsl x10, x9, #3
0x1007cc8b0 <+368>: cmp x10, #64
0x1007cc8b4 <+372>: b.hs 0x1007cc8dc ; <+412>
0x1007cc8b8 <+376>: and x8, x8, #0xff
0x1007cc8bc <+380>: lsl x8, x8, x10
0x1007cc8c0 <+384>: orr x8, x8, x11
0x1007cc8c4 <+388>: str x8, [sp, #8]
0x1007cc8c8 <+392>: add x8, sp, #8
0x1007cc8cc <+396>: add x8, x9, x8
0x1007cc8d0 <+400>: add x1, x8, #1
0x1007cc8d4 <+404>: add x0, sp, #8
0x1007cc8d8 <+408>: b 0x1007cc75c ; <+28>
0x1007cc8dc <+412>: adr x0, #807928 ; "fatal error"
0x1007cc8e0 <+416>: nop
0x1007cc8e4 <+420>: adr x3, #808332 ; "shift amount is larger than type size in bits"
0x1007cc8e8 <+424>: nop
0x1007cc8ec <+428>: movz w1, #0xb
0x1007cc8f0 <+432>: orr w2, wzr, #0x2
0x1007cc8f4 <+436>: movz w4, #0x2d
0x1007cc8f8 <+440>: orr w5, wzr, #0x2
0x1007cc8fc <+444>: bl 0x1007cc740 ; <+0>
0x1007cc900 <+448>: adr x0, #807892 ; "fatal error"
0x1007cc904 <+452>: nop
0x1007cc908 <+456>: adr x3, #811176 ; "value is outside of Unicode codespace"
0x1007cc90c <+460>: nop
0x1007cc910 <+464>: movz w1, #0xb
0x1007cc914 <+468>: orr w2, wzr, #0x2
0x1007cc918 <+472>: movz w4, #0x25
0x1007cc91c <+476>: orr w5, wzr, #0x2
0x1007cc920 <+480>: bl 0x1007cc740 ; <+0>
0x1007cc924 <+484>: lsr w10, w0, #18
0x1007cc928 <+488>: orr w11, w10, #0xf0
0x1007cc92c <+492>: cmp w11, w11, uxtb
0x1007cc930 <+496>: b.ne 0x1007cc94c ; <+524>
0x1007cc934 <+500>: orr w10, wzr, #0xffffff80
0x1007cc938 <+504>: bfxil w10, w0, #12, #6
0x1007cc93c <+508>: and x11, x11, #0xff
0x1007cc940 <+512>: str x11, [sp, #8]
0x1007cc944 <+516>: orr w12, wzr, #0x1
0x1007cc948 <+520>: b 0x1007cc854 ; <+276>
0x1007cc94c <+524>: brk #0x1
为什么函数中的一行未被调用导致崩溃?