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

URLSession crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Foundation
    • Labels:
      None

      Description

      The following code hits a Trace/breakpoint trap

      import Foundation
      import Dispatch
      
      func run() {
          var request = URLRequest(url: URL(string: "http://httpstat.us/200")!)
          request.httpMethod = "GET"
          print("req: \(request.description)")
          let session = URLSession(configuration: .default)
          let task = session.dataTask(with: request) { data, response, error in
              print("response: \(response)")
          }
          task.resume()
      }
      
      run()
      dispatchMain()
      

        Attachments

          Activity

            People

            Assignee:
            pushkar Pushkar Kulkarni
            Reporter:
            pushkar Pushkar Kulkarni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: