要求是为文件创建SHA256密钥:
我已创建NSOperation来读取文件
我正在使用NSInputStream读取大文件并存储在Byte变量中。对于较旧的iOS版本(如11.4),我们不会遇到任何崩溃。
在iOS 12.3中,读取时发生崩溃。因此,我将最大并发操作数设为1。此后已确定。
但是在最新的iOS 12.3.2中,仍然发生以下崩溃。我不知道该如何解决。
注意-文件大小为957898752字节
Crashed: ReadStreamGen4 Queue (QOS: UNSPECIFIED)
0 libcorecrypto.dylib 0x185f048a0 ccsha256_vng_armv7neon_compress + 16
1 libcorecrypto.dylib 0x185edffe0 ccdigest_update + 264
2 libcorecrypto.dylib 0x185ede81c ccdigest + 120
3 libcommonCrypto.dylib 0x185eb940c CCDigest + 52
4 libcommonCrypto.dylib 0x185eba104 CC_SHA256 + 40
5 AhaHUPoc 0x100e9fc28 __122-[MapUpdateServiceGen4 createDeviceLockedLicenseFile:docPath:baseFilePath:productCodeVal:deviceCodeVal:completionHandler:]_block_invoke_2 + 3805 (MapUpdateServiceGen4.m:3805)
6 AhaHUPoc 0x100ec8628 -[ReadStreamGen4 stream:handleEvent:] + 109 (ReadStreamGen4.m:109)
7 CoreFoundation 0x1864ee4d0 _signalEventSync + 212
8 CoreFoundation 0x1864ee3dc _cfstream_shared_signalEventSync + 460
9 CoreFoundation 0x18655e97c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
10 CoreFoundation 0x18655e8fc __CFRunLoopDoSource0 + 88
11 CoreFoundation 0x18655e184 __CFRunLoopDoSources0 + 204
12 CoreFoundation 0x18655bd5c __CFRunLoopRun + 1048
13 CoreFoundation 0x18647be58 CFRunLoopRunSpecific + 436
14 Foundation 0x186eb1594 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
15 Foundation 0x186f0356c -[NSRunLoop(NSRunLoop) run] + 88
16 AhaHUPoc 0x100ec8134 -[ReadStreamGen4 main] + 79 (ReadStreamGen4.m:79)
17 Foundation 0x186ebd4c4 -[__NSOperationInternal _start:] + 848
18 Foundation 0x186f8f894 __NSOQSchedule_f + 404
19 libdispatch.dylib 0x185f32a14 _dispatch_client_callout + 16
20 libdispatch.dylib 0x185f3af08 _dispatch_continuation_pop$VARIANT$mp + 428
21 libdispatch.dylib 0x185f3980c _dispatch_async_redirect_invoke$VARIANT$mp + 604
22 libdispatch.dylib 0x185f3fcf4 _dispatch_root_queue_drain + 600
23 libdispatch.dylib 0x185f3fa38 _dispatch_worker_thread3 + 120
24 libsystem_pthread.dylib 0x1861db06c _pthread_wqthread + 1268
25 libsystem_pthread.dylib 0x1861dab6c start_wqthread + 4