【问题标题】:CIFilter causes a crash on iPhone 11 and XRCIFilter 导致 iPhone 11 和 XR 崩溃
【发布时间】:2020-09-27 08:01:27
【问题描述】:

CIFilter 的所有初始化都会导致某些设备 iPhone 11 和 iPhone XR 崩溃。 iOS 版本 13.3.1、13.4.1。

我尝试导入:

import CoreImage
import CoreImage.CIFilter
import CoreImage.CIFilterBuiltins

但它不起作用! 我使用 xCode 11.4.1 和 xCode 11.5

我已经尝试了几件事:

        if let filter = CIFilter(name: "CIQRCodeGenerator") {

        filter.setValue(data, forKey: "inputMessage")
        let transform = CGAffineTransform(scaleX: 5, y: 5)

        if let output = filter.outputImage?.transformed(by: transform) {
            return UIImage(ciImage: output)
        }
    }

或者这个:

let filter = CIFilter.qrCodeGenerator()

我还尝试在目标设置中明确链接到CoreImage.framework

崩溃日志:

Crashed: com.apple.main-thread
0  CocoaDebug                     0x1023a0adc perform_rebinding_with_section + 332
1  CocoaDebug                     0x1023a087c rebind_symbols_for_image + 416
2  libdyld.dylib                  0x1999c3f4c invocation function for block in dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 244
3  libdyld.dylib                  0x1999c3768 dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 160
4  libdyld.dylib                  0x1999c8dd8 dyld3::AllImages::loadImage(Diagnostics&, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool) + 580
5  libdyld.dylib                  0x1999c89ec dyld3::AllImages::dlopen(Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*) + 868
6  libdyld.dylib                  0x1999ca434 dyld3::dlopen_internal(char const*, int, void*) + 364
7  libdyld.dylib                  0x1999bd6c0 dlopen + 116
8  CoreFoundation                 0x199bcf5c8 _CFBundleDlfcnLoadBundle + 156
9  CoreFoundation                 0x199af1eac _CFBundleLoadExecutableAndReturnError + 372
10 Foundation                     0x199ec27a8 -[NSBundle loadAndReturnError:] + 316
11 CoreImage                      0x19b479bcc invocation function for block in register_more_builtins(void (NSString*) block_pointer) + 804
12 libdispatch.dylib              0x19986833c _dispatch_client_callout + 20
13 libdispatch.dylib              0x199869a68 _dispatch_once_callout + 32
14 CoreImage                      0x19b476318 register_more_builtins(void (NSString*) block_pointer) + 304
15 CoreImage                      0x19b476b40 classNameIsSystemFilter(NSString*) + 112
16 CoreImage                      0x19b476dbc +[CIFilter(CIFilterRegistryPrivate) filterWithName:setDefaults:] + 396
17 MYApp                          0x100656598 QRCodeViewController.generateQRCode(from:) + 4370490776 (<compiler-generated>:4370490776)
18 MYApp                          0x1006563a4 QRCodeViewController.viewDidLoad() + 28 (QRCodeViewController.swift:28)
19 MYApp                          0x10065642c @objc QRCodeViewController.viewDidLoad() + 4370490412 (<compiler-generated>:4370490412)
20 UIKitCore                      0x19d6a236c -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 104
21 UIKitCore                      0x19d6a6f20 -[UIViewController loadViewIfRequired] + 952
22 UIKitCore                      0x19d6a730c -[UIViewController view] + 32
23 UIKitCore                      0x19d602fa4 -[UINavigationController _startCustomTransition:] + 1148
24 UIKitCore                      0x19d617478 -[UINavigationController _startDeferredTransitionIfNeeded:] + 692
25 UIKitCore                      0x19d618818 -[UINavigationController __viewWillLayoutSubviews] + 176
26 UIKitCore                      0x19d5fb4fc -[UILayoutContainerView layoutSubviews] + 228
27 UIKitCore                      0x19e1de6a0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2168
28 QuartzCore                     0x1a08314a0 -[CALayer layoutSublayers] + 292
29 QuartzCore                     0x1a08318e0 CA::Layer::layout_if_needed(CA::Transaction*) + 472
30 QuartzCore                     0x1a0843dc4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
31 QuartzCore                     0x1a0788884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
32 QuartzCore                     0x1a07b33d0 CA::Transaction::commit() + 656
33 QuartzCore                     0x1a07b3fc8 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 96
34 CoreFoundation                 0x199b42c54 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
35 CoreFoundation                 0x199b3d8e4 __CFRunLoopDoObservers + 420
36 CoreFoundation                 0x199b3dd84 __CFRunLoopRun + 1020
37 CoreFoundation                 0x199b3d660 CFRunLoopRunSpecific + 480
38 GraphicsServices               0x1a3f4e604 GSEventRunModal + 164
39 UIKitCore                      0x19dd1215c UIApplicationMain + 1944
40 MYApp                          0x100518e54 main + 4369190484 (<compiler-generated>:4369190484)
41 libdyld.dylib                  0x1999b91ec start + 4

使用模拟器效果很好。

有人会知道吗? 谢谢

【问题讨论】:

  • 你能说明你是如何初始化过滤器的吗?
  • @FrankSchlegel 我的帖子更新了更多细节......
  • 这确实很奇怪,虽然我以前用另一个过滤器看到过这个。您是否尝试过明确链接到CoreImage.framework(在您的目标设置中)?
  • @FrankSchlegel 是的,我试过了,它仍然崩溃。
  • 仍然是 stackoverflow.com/questions/61573397/… 的副本。你为什么不编辑stackoverflow.com/questions/61573397/…呢?你已经问过同样的问题三遍了!

标签: ios swift crash core-image cifilter


【解决方案1】:

我想出了如何解决它。 问题是第三方CocoaDebug! 我移除了吊舱,我再也没有崩溃了! 谢谢!

【讨论】:

    猜你喜欢
    • 2020-08-17
    • 1970-01-01
    • 1970-01-01
    • 2012-09-17
    • 1970-01-01
    • 2010-11-02
    • 1970-01-01
    • 1970-01-01
    • 2018-12-14
    相关资源
    最近更新 更多