{"action":"created","issue":{"url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/4","labels_url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/4/comments","events_url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/4/events","html_url":"https://github.com/bryanjclark/ios-darken-image-with-cifilter/issues/4","id":24212999,"number":4,"title":"Weird crash in extremely rare cases","user":{"login":"shpakovski","id":163410,"avatar_url":"https://avatars.githubusercontent.com/u/163410?v=3","gravatar_id":"","url":"https://api.github.com/users/shpakovski","html_url":"https://github.com/shpakovski","followers_url":"https://api.github.com/users/shpakovski/followers","following_url":"https://api.github.com/users/shpakovski/following{/other_user}","gists_url":"https://api.github.com/users/shpakovski/gists{/gist_id}","starred_url":"https://api.github.com/users/shpakovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shpakovski/subscriptions","organizations_url":"https://api.github.com/users/shpakovski/orgs","repos_url":"https://api.github.com/users/shpakovski/repos","events_url":"https://api.github.com/users/shpakovski/events{/privacy}","received_events_url":"https://api.github.com/users/shpakovski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2013-12-12T22:18:09Z","updated_at":"2015-05-29T14:36:30Z","closed_at":"2013-12-24T20:38:18Z","body":"Hello,\r\n\r\nWe use your code in a Universal iOS app that has been downloaded more than 10k times. The app is game-ish and uses the set of the given CI filters once a minute for the picture of the screen size. So it seems like this code worked fine at least 100k times.\r\n\r\nHowever, we've got about 10 crash reports `SIGSEGV: SEGV_ACCERR at 0x1` with the following stack trace:\r\n```\r\n0   libGPUSupportMercury.dylib           0x320918fe gpus_ReturnNotPermittedKillClient + 10\r\n1   IMGSGX543GLDriver                    0x2c56f88d <redacted> + 124\r\n2   GLEngine                             0x2f93f1b3 glFinish_Exec + 87\r\n3   CoreImage                            0x2dbd5899 CI::GLESContext::render(CI::Node*, CGRect) + 41\r\n4   CoreImage                            0x2dbdc9ff CI::image_get_cgimage(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::PixelFormat) + 1007\r\n5   CoreImage                            0x2dbc566b -[CIContext createCGImage:fromRect:format:colorSpace:] + 447\r\n6   CoreImage                            0x2dbc5455 -[CIContext createCGImage:fromRect:] + 89\r\n```\r\n\r\nHere is a list of affected devices:\r\n```\r\niPhone 4 (GSM) 7.0\r\niPhone 4S 7.0\r\niPhone 4S 7.0.2\r\niPhone 5s (A1433/A1553) 7.0.4\r\niPad (3rd gen, Wi-Fi+LTE AT&T) 7.0.2\r\niPod touch (5th gen) 7.0.4 — 5 crashes\r\n```\r\n\r\nWe have no idea how to reproduce or fix this. In one of the updates, we wrapped `[context createCGImage:blurredImage fromRect:inputImage.extent]` into `@try {} @catch {}` but this did not help. The app cannot be restored after such kind of exception and exits anyway.\r\n\r\nMaybe you have met this problem with your apps? Any advise would be really helpful.\r\n\r\nThanks in advance,\r\nVadim\r\n\r\n**UPDATE:** It will hardly help, but the code is executed in background thread. And here is a full version: https://gist.github.com/shpakovski/3eb37ea91112de742742"},"comment":{"url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/comments/106829502","html_url":"https://github.com/bryanjclark/ios-darken-image-with-cifilter/issues/4#issuecomment-106829502","issue_url":"https://api.github.com/repos/bryanjclark/ios-darken-image-with-cifilter/issues/4","id":106829502,"user":{"login":"EaswaramoorthyKanagaraj","id":2968740,"avatar_url":"https://avatars.githubusercontent.com/u/2968740?v=3","gravatar_id":"","url":"https://api.github.com/users/EaswaramoorthyKanagaraj","html_url":"https://github.com/EaswaramoorthyKanagaraj","followers_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/followers","following_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/following{/other_user}","gists_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/gists{/gist_id}","starred_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/subscriptions","organizations_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/orgs","repos_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/repos","events_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/events{/privacy}","received_events_url":"https://api.github.com/users/EaswaramoorthyKanagaraj/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T14:36:30Z","updated_at":"2015-05-29T14:36:30Z","body":"@shpakovski \r\nJust found one alternative to my implementation. There is a new feature available in iOS 8, which is UIVisualEffectView to do some effects like blur. \r\n\r\n    UIGraphicsBeginImageContext(view.bounds.size);\r\n    [view.layer renderInContext:UIGraphicsGetCurrentContext()];\r\n    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();\r\n    UIGraphicsEndImageContext();\r\n    UIVisualEffect *blurEffect;\r\n    blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];\r\n    UIVisualEffectView *visualEffectView;\r\n    visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];\r\n    UIImageView *imageView = [[UIImageView alloc] initWithImage:viewImage];\r\n    visualEffectView.frame = imageView.bounds;\r\n    [imageView addSubview:visualEffectView]; // Now the imageView will have the blurred effect. \r\n\r\nHope this helps, if you are looking for such implementations.\r\n \r\nNote: Only for iOS 8.\r\n"}}