title: What does error Thread 8: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) and what is the problem?
body: <p>For learning purposes, declared a <code>DispatchQueue</code> inside the demo project.</p>
  <p>When I tap the button, the &quot;Statement 1&quot; is printed in the console and after a few seconds the application crashes with the error:</p>
  <blockquote>
  <p>Thread 8: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)</p>
  </blockquote>
  <p>I know that asynchronous means that the two things don't know or care when the other is happening. Sync implies that two things must occur at the same time, or alternatively, that one of them must wait until the other one catches up.</p>
  <p>Can anyone explain why the app crashed?</p>
  <pre><code>@IBAction func queuePrint(_ sender: UIButton) {        
      let queue = DispatchQueue(label: &quot;io.myQueue.queue&quot;)
      queue.async {
          print(&quot;Statement 1&quot;)
          queue.sync {
              print(&quot;Statement 2&quot;)
              queue.async {
                  print(&quot;Statement 3&quot;)
              }
          }
      }
      queue.async {
          print(&quot;Statement 4&quot;)
      }
      queue.async {
          print(&quot;Statement 5&quot;)
      }
  }
  </code></pre>