Uploaded image for project: 'Swift'
  1. Swift
  2. SR-384

`NSURLComponents.queryItems` crashes on Linux

    XMLWordPrintable

    Details

      Description

      To reproduce in LLDB:

      import Foundation
      let c = NSURLComponents(string: "http://google.com/search/param/hello?q=hi&thing=foo")
      c?.queryItems
      // Crash
      
      :bt
      * thread #1: tid = 28, 0x00007ffff4059330 libFoundation.so`__HALT, name = 'repl_swift', stop reason = signal SIGILL: illegal instruction operand
        * frame #0: 0x00007ffff4059330 libFoundation.so`__HALT
          frame #1: 0x00007ffff40688c4 libFoundation.so`CFBasicHashAddValue + 228
          frame #2: 0x00007ffff407383e libFoundation.so`CFDictionaryCreate + 286
          frame #3: 0x00007ffff411665d libFoundation.so`_CFURLComponentsCopyQueryItems + 781
          frame #4: 0x00007ffff4328184 libFoundation.so`Foundation.NSURLComponents.queryItems.getter : Swift.Optional<Swift.Array<Foundation.NSURLQueryItem>> + 116
          frame #5: 0x00007ffff7ff4ae8 $__lldb_expr19
          frame #6: 0x0000000000400830 repl_swift`__gmon_start__ + 16
      

      I expect this to return an Optional array of two NSURLQueryItems.

      I have no idea what's going wrong here, but I'm tempted to rewrite the copy routine in Swift.

        Attachments

          Activity

            People

            • Assignee:
              saiHema sai Hema k
              Reporter:
              swizzlr Thomas Catterall
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: