title: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS
body: <p>Application Crash 1/4 times while downloading</p>
  <p>Crash log here. i didn't understand how to fix it.</p>
  <pre class="lang-none prettyprint-override"><code>Incident Identifier: 36BCCA72-9FBF-448A-BCA7-AACB0195B311
  Hardware Model:      iPhone12,3
  Process:             iBIBLE [16728]
  Path:                /private/var/containers/Bundle/Application/E384D4A1-AD75-4693-94D5-335B158C3452/iBIBLE.app/iBIBLE
  Identifier:          com.revelationmedia-iBible
  Version:             23 (1.0)
  AppStoreTools:       13C90b
  AppVariant:          1:iPhone12,3:14
  Beta:                YES
  Code Type:           ARM-64 (Native)
  Role:                Foreground
  Parent Process:      launchd [1]
  Coalition:           com.revelationmedia-iBible [2371]
  
  
  Date/Time:           2022-01-28 08:44:59.9791 -0800
  Launch Time:         2022-01-28 08:44:46.7851 -0800
  OS Version:          iPhone OS 14.8 (18H17)
  Release Type:        User
  Baseband Version:    2.06.00
  Report Version:      104
  
  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
  Exception Subtype: KERN_INVALID_ADDRESS at 0x8000000000000040 -&gt; 0x0000000000000040 (possible pointer authentication failure)
  VM Region Info: 0x40 is not in any region.  Bytes before following region: 4336795584
        REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
        UNUSED SPACE AT START
  ---&gt;  
        __TEXT                   1027e4000-1027f0000 [   48K] r-x/r-x SM=COW  ...LE.app/iBIBLE
  </code></pre>
  <pre><code>@objc private func updateProgress() {
      delegate?.downloadTask(self, didWriteData: totalBytesWritten.values.reduce(0, +),
                             totalBytesExpectedToWrite: totalBytesExpectedToWrite.values.reduce(0, +))
  }
  
   func downloadTask(_ task: ChapterDownloadTask, didWriteData totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64){
          let value = self.downloading.value
          guard totalBytesWritten &gt; 0 &amp;&amp; totalBytesExpectedToWrite &gt; 0,
              let chapter = task.chapter,
              let index = value
                  .firstIndex(where: {$0.chapter.systemName == chapter.systemName}) else {
              return
          }
  
          value[index].totalBytesExpectedToWrite = totalBytesExpectedToWrite
          value[index].totalBytesWritten = totalBytesWritten
          self.downloading.accept(value)
      }
  </code></pre>