3

Start seeing this crash on Crashlytics after we built with XCode 9, and all crashes happen on iOS 11 devices (though it could just be most people are on iOS 11 today)

Crashed: com.apple.main-thread
0  CoreImage                      0x186ff417c CI::GLContext::init() + 276
1  CoreImage                      0x186ff4158 CI::GLContext::init() + 240
2  CoreImage                      0x186ff4514 CI::GLContext::GLContext(CI::GLContext::ShareContextInfo, CGColorSpace*, CGColorSpace*, CI::PixelFormat, bool, unsigned long, bool, bool) + 416
3  CoreImage                      0x186ff4544 CI::GLContext::GLContext(CI::GLContext::ShareContextInfo, CGColorSpace*, CGColorSpace*, CI::PixelFormat, bool, unsigned long, bool, bool) + 24
4  CoreImage                      0x186fba50c +[CIContext(Internal) internalContextWithEAGLContext:options:] + 756
5  CoreImage                      0x186fb6514 -[CIContext initWithOptions:] + 820
6  CoreImage                      0x186fb61bc +[CIContext contextWithOptions:] + 52
7  UIKit                          0x18b9759ac -[UIImage drawInRect:blendMode:alpha:] + 1072
8  UIKit                          0x18be6fad4 -[UIImageView drawRect:] + 116
9  UIKit                          0x18b9e3fdc -[UIView(CALayerDelegate) drawLayer:inContext:] + 536
10 QuartzCore                     0x185f34e18 -[CALayer drawInContext:] + 296
11 QuartzCore                     0x185f3455c -[CALayer _display] + 936
12 QuartzCore                     0x185ea5b64 CA::Context::commit_transaction(CA::Transaction*) + 516
13 QuartzCore                     0x185ecd5d0 CA::Transaction::commit() + 580
14 UIKit                          0x18bc515cc _afterCACommitHandler + 256
15 CoreFoundation                 0x181d66910 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
16 CoreFoundation                 0x181d64238 __CFRunLoopDoObservers + 412
17 CoreFoundation                 0x181d64884 __CFRunLoopRun + 1436
18 CoreFoundation                 0x181c84da8 CFRunLoopRunSpecific + 552
19 GraphicsServices               0x183c67020 GSEventRunModal + 100
20 UIKit                          0x18bc6578c UIApplicationMain + 236

Some code snippets that are potential candidates for this crash:

public extension UIImage {
@objc public convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) {
    let ciImage = CoreImage.CIImage(color: CIColor(cgColor: color.cgColor))
                    .cropping(to: CGRect(origin: CGPoint.zero, size: size))
    self.init(ciImage: ciImage)
}
}


extension UIImage {
class func imageWithColor(color: UIColor, size: CGSize) -> UIImage {
    let rect: CGRect = CGRect(x:0, y:0, width:size.width, height:size.height)
    UIGraphicsBeginImageContextWithOptions(size, false, 0)
    color.setFill()
    UIRectFill(rect)
    let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
    UIGraphicsEndImageContext()
    return image
}
}

Any ideas of what's going on or debugging tips would be greatly appreciative!

yvetterowe
  • 1,239
  • 7
  • 20
  • 34

0 Answers0