Coder Social home page Coder Social logo

Comments (6)

helje5 avatar helje5 commented on July 22, 2024

What am I supposed to do with 'looks like crash here'? Please file a proper bug report.

from swiftsockets.

cnzui avatar cnzui commented on July 22, 2024

Thank you for your reply. I don't know if the following information below is enough.

My code is very simple:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.

        let sock = ActiveSocket<sockaddr_in>()   //this is line 20

        window?.makeKeyAndVisible()

        let lb:UILabel = UILabel(frame: CGRectMake(50, 50, 300, 100))
        lb.font=UIFont.systemFontOfSize(12)
        lb.text="Socket:\(sock)"
        window?.addSubview(lb)

        return true
    }

and this is the crash information:

socktest`socktest.ActiveSocket.init <A where A: socktest.SocketAddress> (socktest.ActiveSocket<A>.Type)(fd : socktest.FileDescriptor) -> socktest.ActiveSocket<A>:
    0x3a050 <+0>:   push   {r4, r5, r6, r7, lr}
    0x3a054 <+4>:   add    r7, sp, #12
    0x3a058 <+8>:   push   {r8, r10, r11}
    0x3a05c <+12>:  sub    sp, sp, #16
    0x3a060 <+16>:  mov    r4, r1
    0x3a064 <+20>:  str    r0, [sp]
    0x3a068 <+24>:  ldr    r1, [r4]
    0x3a06c <+28>:  movw   r0, #0x4240
    0x3a070 <+32>:  movt   r0, #0x2
    0x3a074 <+36>:  ldr    r0, [pc, r0]
    0x3a078 <+40>:  ldr    r5, [r1, #0xa8]
    0x3a07c <+44>:  mov    r1, r5
    0x3a080 <+48>:  bl     0x5df88                   ; symbol stub for: swift_getGenericMetadata1
    0x3a084 <+52>:  mov    r10, r0
    0x3a088 <+56>:  add    r0, sp, #4
    0x3a08c <+60>:  ldr    r8, [r10, #-0x4]
    0x3a090 <+64>:  mov    r1, r10
    0x3a094 <+68>:  ldr    r2, [r8, #0x2c]
    0x3a098 <+72>:  blx    r2
    0x3a09c <+76>:  mov    r6, r0
    0x3a0a0 <+80>:  mov    r1, r5
    0x3a0a4 <+84>:  mov    r2, #0
    0x3a0a8 <+88>:  mov    r3, #1
    0x3a0ac <+92>:  bl     0x5dfe4                   ; symbol stub for: swift_storeEnumTagSinglePayload
    0x3a0b0 <+96>:  ldr    r0, [r4]
    0x3a0b4 <+100>: mov    r1, r5
    0x3a0b8 <+104>: mov    r2, #1
    0x3a0bc <+108>: ldr    r11, [r0, #0x12c]
    0x3a0c0 <+112>: mov    r0, r6
    0x3a0c4 <+116>: bl     0x5df6c                   ; symbol stub for: swift_getEnumCaseSinglePayload
    0x3a0c8 <+120>: add    r11, r4, r11
    0x3a0cc <+124>: cmn    r0, #1
    0x3a0d0 <+128>: beq    0x3a0e8                   ; <+152> at ActiveSocket.swift:45
    0x3a0d4 <+132>: ldr    r2, [r8, #0x44]
    0x3a0d8 <+136>: mov    r0, r11
    0x3a0dc <+140>: mov    r1, r6
    0x3a0e0 <+144>: bl     0x5dde0                   ; symbol stub for: memcpy
    0x3a0e4 <+148>: b      0x3a114                   ; <+196> at ActiveSocket.swift:45
    0x3a0e8 <+152>: ldr    r0, [r5, #-0x4]
    0x3a0ec <+156>: mov    r1, r6
    0x3a0f0 <+160>: mov    r2, r5
    0x3a0f4 <+164>: ldr    r3, [r0, #0x24]
    0x3a0f8 <+168>: mov    r0, r11
    0x3a0fc <+172>: blx    r3
    0x3a100 <+176>: mov    r0, r11
    0x3a104 <+180>: mov    r1, r5
    0x3a108 <+184>: mvn    r2, #0
    0x3a10c <+188>: mov    r3, #1
    0x3a110 <+192>: bl     0x5dfe4                   ; symbol stub for: swift_storeEnumTagSinglePayload
    0x3a114 <+196>: ldr    r2, [r8, #0xc]
    0x3a118 <+200>: add    r0, sp, #4
    0x3a11c <+204>: mov    r1, r10
    0x3a120 <+208>: blx    r2
    0x3a124 <+212>: ldr    r0, [r4]
    0x3a128 <+216>: mov    r1, #0
    0x3a12c <+220>: vmov.i32 d16, #0x0
    0x3a130 <+224>: ldr    r0, [r0, #0x130]
    0x3a134 <+228>: str    r1, [r4, r0]
    0x3a138 <+232>: ldr    r0, [r4]
    0x3a13c <+236>: ldr    r0, [r0, #0x134]
    0x3a140 <+240>: str    r1, [r4, r0]
    0x3a144 <+244>: ldr    r0, [r4]
    0x3a148 <+248>: ldr    r0, [r0, #0x138]
    0x3a14c <+252>: str    r1, [r4, r0]
    0x3a150 <+256>: ldr    r0, [r4]
    0x3a154 <+260>: ldr    r0, [r0, #0x13c]
    0x3a158 <+264>: strb   r1, [r4, r0]
    0x3a15c <+268>: ldr    r0, [r4]
    0x3a160 <+272>: ldr    r0, [r0, #0x140]
    0x3a164 <+276>: strb   r1, [r4, r0]
    0x3a168 <+280>: mov    r1, #0
    0x3a16c <+284>: ldr    r0, [r4]
    0x3a170 <+288>: ldr    r0, [r0, #0x144]
    0x3a174 <+292>: add    r0, r4, r0
->  0x3a178 <+296>: vstr   d16, [r0]         Thread 1:EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN,address=0x16541dea
    0x3a17c <+300>: movw   r0, #0x1002
    0x3a180 <+304>: bl     0x5dfd8                   ; symbol stub for: swift_slowAlloc
    0x3a184 <+308>: ldr    r1, [r4]
    0x3a188 <+312>: ldr    r1, [r1, #0x148]
    0x3a18c <+316>: str    r0, [r4, r1]
    0x3a190 <+320>: mov    r1, #4096
    0x3a194 <+324>: ldr    r0, [r4]
    0x3a198 <+328>: ldr    r0, [r0, #0x14c]
    0x3a19c <+332>: str    r1, [r4, r0]
    0x3a1a0 <+336>: mov    r1, r4
    0x3a1a4 <+340>: ldr    r0, [sp]
    0x3a1a8 <+344>: bl     0x40940                   ; socktest.Socket.init <A where A: socktest.SocketAddress> (socktest.Socket<A>.Type)(fd : socktest.FileDescriptor) -> socktest.Socket<A> at Socket.swift:30
    0x3a1ac <+348>: sub    sp, r7, #24
    0x3a1b0 <+352>: pop    {r8, r10, r11}
    0x3a1b4 <+356>: pop    {r4, r5, r6, r7, pc}

and the stack information is:

Thread 1Queue : com.apple.main-thread (serial)
#0  0x0003a178 in ActiveSocket.init<A where ...>(fd : FileDescriptor) -> ActiveSocket<A> at /Users/longzhipei/Desktop/socktest/ARISockets/ActiveSocket.swift:52
#1  0x0003a2dc in ActiveSocket.init<A where ...>(type : Int32) -> ActiveSocket<A>? [inlined] at /Users/longzhipei/Desktop/socktest/ARISockets/ActiveSocket.swift:93
#2  0x0003a2a8 in ActiveSocket.__allocating_init<A where ...>(type : Int32) -> ActiveSocket<A>? ()
#3  0x0004a7f4 in AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [NSObject : AnyObject]?) -> Bool [inlined] at /Users/longzhipei/Desktop/socktest/socktest/AppDelegate.swift:20
#4  0x0004a778 in @objc AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [NSObject : AnyObject]?) -> Bool ()
#5  0x330f8cc0 in -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] ()
#6  0x330f8612 in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] ()
#7  0x330f2cc8 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#8  0x3308ec96 in -[UIApplication handleEvent:withNewEvent:] ()
#9  0x3308ddf8 in -[UIApplication sendEvent:] ()
#10 0x330f2404 in _UIApplicationHandleEvent ()
#11 0x356fbb54 in _PurpleEventCallback ()
#12 0x356fb73e in PurpleEventCallback ()
#13 0x30824846 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#14 0x308247e2 in __CFRunLoopDoSource1 ()
#15 0x30822fae in __CFRunLoopRun ()
#16 0x3078d768 in CFRunLoopRunSpecific ()
#17 0x3078d54a in CFRunLoopRunInMode ()
#18 0x330f162a in -[UIApplication _run] ()
#19 0x330ec890 in UIApplicationMain ()
#20 0x0004ae2c in main at /Users/longzhipei/Desktop/socktest/socktest/AppDelegate.swift:12

from swiftsockets.

helje5 avatar helje5 commented on July 22, 2024

Sounds like a Swift compiler bug, but I guess I should try to repro this.

from swiftsockets.

helje5 avatar helje5 commented on July 22, 2024

Someone else seeing this? If so, maybe send me a sample Xcode project showing the bug. Closing it for now.

from swiftsockets.

cnzui avatar cnzui commented on July 22, 2024

socktest.zip

I'm sorry I didn't see the message until now. This is the project.

from swiftsockets.

helje5 avatar helje5 commented on July 22, 2024

Hm, sounds like El Capitan can't run iOS7 simulators anymore. Hence I can't test it w/o extra effort. And I suppose I don't really care about iOS7 for this kind of project anyways :-)

from swiftsockets.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.