KDCircularProgress icon indicating copy to clipboard operation
KDCircularProgress copied to clipboard

crash on iOS 9.3.6

Open pop-goes-the-Weasel opened this issue 5 years ago • 12 comments

while using this framework on devices containing iOS latest 9.3.6 version , there is a crash on the following

override init() {
super.init()
}

of private class KDCircularProgressViewLayer: CALayer

Xcode: 11.5 MacOS: Catalina Device: iPad 3

pop-goes-the-Weasel avatar Jun 19 '20 07:06 pop-goes-the-Weasel

@kaandedeoglu you're help would be appreciated

pop-goes-the-Weasel avatar Jun 19 '20 07:06 pop-goes-the-Weasel

I am having the same problem.

StevenBolin avatar Jul 02 '20 14:07 StevenBolin

Do you have any crash logs, screenshots, or any leads you can post here please?

kaandedeoglu avatar Jul 02 '20 14:07 kaandedeoglu

Sure. Screen Shot 2020-07-02 at 9 39 02 AM

StevenBolin avatar Jul 02 '20 14:07 StevenBolin

i have my live app crashing to this, please provide a fix for it or point me in the right direction to the resolution of this crash. screenshot and .log file is attached for further debugging process. Just remember, to reproduce this you'll need ipad with lower ios version i.e 9.3.6 version and a latest xcode i.e 11.5

Screen Shot 2020-07-27 at 12 36 54 PM

kCircularCrash.log

@kaandedeoglu

pop-goes-the-Weasel avatar Jul 27 '20 07:07 pop-goes-the-Weasel

@HamzaAtcoding I unfortunately don't own such device to reproduce the crash. One possible solution comes to mind:

It seems like the crash occurs while KDCircularProgress is being initialized through the IB. (KDCircularProgress is created through init(coder:) but KDCircularProgressViewLayer is created through init())

One thing you can try is to only keep a container UIView for KDCircularProgress in the IB. And in viewDidLoad create the progress view programatically and add to the container, would that solve the issue?

kaandedeoglu avatar Jul 27 '20 08:07 kaandedeoglu

as per your recommendation i have made the KDCircularProgress in viewdidload for UIView container programmatically,

//        progressView = KDCircularProgress(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
        progressView = KDCircularProgress(frame: CGRect(x: 0, y: 0, width: 300, height: 300), colors: UIColor.cyan)
//        progressView.startAngle = -90
//        progressView.progressThickness = 0.2
//        progressView.trackThickness = 0.6
//        progressView.clockwise = true
//        progressView.gradientRotateSpeed = 2
//        progressView.roundedCorners = false
//        progressView.glowMode = .forward
//        progressView.glowAmount = 0.9
//        progressView.set(colors: UIColor.cyan ,UIColor.white, UIColor.magenta, UIColor.white, UIColor.orange)
//        progressView.center = CGPoint(x: view.center.x, y: view.center.y + 25)
        view.addSubview(progressView)

these are my findings,

whatever init() i use required public init(coder aDecoder: NSCoder) going through storyboard

convenience public init(frame:CGRect, colors: UIColor...) going through convenience init

override public init(frame: CGRect) going through public

all of these leads to crash in the designated overridden init(), i have trimmed it down as much as to close all properties and create a simple frame and add in view, but still a crash.

Maybe it has to do something in the way frame is created in KDCircularProgress that might be iOS 10+ versions dependent and not found in lower iOS version?

@kaandedeoglu

pop-goes-the-Weasel avatar Jul 27 '20 11:07 pop-goes-the-Weasel

@HamzaAtcoding I'm really sorry, but I don't have anything. I'm not clear how a simple init is crashing..

kaandedeoglu avatar Aug 04 '20 11:08 kaandedeoglu

any debugging that would help? @kaandedeoglu

pop-goes-the-Weasel avatar Aug 05 '20 05:08 pop-goes-the-Weasel

could this be the issue with older iPads not having enough memory? i got this through debugging session with address sanitizer

==436==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-1103.0.32.62/compiler-rt/lib/sanitizer_common/sanitizer_mac_libcdep.cc:24 "((res != ((void *)-1))) != (0)" (0x0, 0x0)
    <empty stack>

pop-goes-the-Weasel avatar Aug 05 '20 10:08 pop-goes-the-Weasel

I don't think so, this library was initially developed during iOS 9 was the latest, and it used to work fine. I unfortunately don't have devices / Xcode versions to reproduce it on.

If I were you, I would start dissecting and see what causes the crash. For example just try to keep KDCircularProgress & KDCircularProgressLayer, removing more and more properties as you go along. I have a suspicion the @NSManaged trick might be causing issues..

kaandedeoglu avatar Aug 05 '20 10:08 kaandedeoglu

After a solid dev day on trying to fix this, i can say for sure that this is 110% issue related to older iPads having less memory (i can confirm this by running this on xcode >11.5, compiling and not crashing on it), in the binaries updation of xcode 11.5 it most definitely updated something that causes older iPads memory to take a hit, after-all apple is known for deprecating their older products in devious ways. Even though this was developed in iOS 9.x times as mention by @kaandedeoglu, nobody can foresee the impending wreck that could have been caused by xcode updation, also as i mentioned earlier i have trimmed down the properties i.e. (angles, startAngle, clockwise, progressThickness etc) to just an extent to just make a frame out of it, but still crash took place

pop-goes-the-Weasel avatar Aug 06 '20 11:08 pop-goes-the-Weasel