I'm developing an application that uses the Apple SpriteKit and CoreImage framework. On iOS 10 the application starts and is fluid, but on iOS 11 the application stops and after using the profiling tool "Zombies" I get the message
[MTLDebugTexture release]: message sent to a deallocated instance
(more precisely, it is an instance of AGXMetalA8X that is accessed by jet:: create_texture () but which has been deallocated before by CoreImage... All of those classes belong to frameworks, not to my app)
I've tried many solutions proposed in response to this type of error, but the problem doesn't seem to be directly related to my code.
By adding the option "PrefersOpenGL = YES" in the Info.plist file there is no more this error. However, the graphics rendering is very bad with this option enabled.
I also tried to keep strong references to all the SKNode elements I create and to reduce memory consumption but this only delays the error. Moreover, it is not a very memory-intensive application (about 40MB of RAM consumed, on average, no apparent leak)
XCode 9 , Swift 3.2 , SDK iOS 11
Related
I am getting a crash on firebase on SKStoreProductViewController, while during testing this crash is not being produced.
Is there anyway to resolve this issue? Thanks.
Fatal Exception: NSInvalidArgumentException
-[SKStoreProductViewController sceneDisconnected:]: unrecognized selector sent to instance
How to resolve the reported issue?
This crash happens in the public release of iOS/iPadOS 15.7, and seed releases of iOS/iPadOS 16 prior to seed 4 [1]. It does not occur in the public release of iOS 16.
The crash primarily happens when the app is in the background and is about to be terminated by the operating system. As a result, these crashes are not expected to be visible to the majority of end users. (One exception is on iPad with an app that supports multiple scenes, and a user manually terminates a scene.)
Your analytics will show an increased in crash rate, however your customers should not be affected by this issue.
You can refer to https://developer.apple.com/forums/thread/714464
I've used Xcode's zombie debugger and managed to find this flag upon launch:
This crashed the app, and re-recording from Instruments caused the same result. Relaunching the app from the device made the app launch without a crash and subsequent launches from Instruments resulted in normal operation without flags or crashes.
Can anyone make sense of this or advise? I'm getting a number of "heap corruption" crashes in production. The reports are limited to a handful of users, but I'm afraid that number is growing.
It looks like the Parse SDK's latest release notes (1.15.1) addresses this:
-Adds polygonal queries
-Fixes memory leaks related with PFCommandCache
But my crash reports are coming from builds with this SDK version.
The Parse team has responded saying that a fix for this is coming to a new SDK release soon. :)
When an app is built with -O (fastest) setting , crashes occur very quickly at seemingly random places.
Occurs in latest beta as well as final.
How would one track those down?
Tried allocations instrument with NSZombie detection enabled.
Tried crashlytics and/or device crash reports but they are similarliy cryptic to me.
Started to put debug messages in the code, trying to find out where it sometimes hits.
I read here and on the apple dev formus that it could be related to core data fetches, to upper/lower case String operations, Array conversions from/to NSArray, etc.
All I am getting currently is:
malloc: *** error for object 0x174e3439c: Invalid pointer dequeued from free list
*** set a breakpoint in malloc_error_break to debug
Turning off optimizations in release mode with -Onone seems to fix the problem(s) I am experiencing with my code.
Any pointers would be highly appreciated.
I spent few days working on an app that was built by my friend last year before the release of iOS 8 and Xcode 6+ I believe. He used several libraries like PMCalender , FXforms, MyBlurIntroductionView, CCPickerView, SWRevealTableView etc and I added MBProgressHUD. Now before the app was running without crashes or now as I understand after further studying of the problems I am getting with the app. I believe the app has multiple because of memory leaks. I read his code before modifying it and just noticed there are compile sources he put i.e -fno-objc-arc or fobjc-arc. About a day ago after attempting to integrate SPGooglePlaceAutocomplete for some reason I had to disable Objective-C ARC from Build Settings and then the whole project build with lots of errors. That I had to change weak object to strong in some header file and so forth.
Now I tried to read this for more understanding Apple Transitioning to ARC release NOte
I am posting this question because I'm would say I'm a newbie to iOS development but catching up pretty fast. I need help to have a smooth running app with crashes because. What I am experiencing is not clear to the point that I had to use Instruments to see exactly what is causing the app to crash whereas coming into the app several time at some point it does not crash. When it crashes I get this only thread x and can't really know where to debug
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
The add has MapKit and first thing after login screen it should zoom to the user current location. Reason why I used Instruments to see what is happening with the app is because I was suspecting perhaps CoreLocation is causing the crash to connect to the remote CCLocationManager services. As I noticed my phone takes time to turn on gps and it does not always stay on even if I have request location always [self.locationManager requestAlwaysAuthorization];
So I am hoping someone can help me because I did the whole ARC transitioning but still have release, autorelease errors. All my IUOutlet are weak.
Here are the 6 errors I am left with removing with hoping the app will run normal.
I this this is the answer to my question, which can be helpful to others after long search and debugging.
http://www.daveoncode.com/2011/10/24/migration-to-arc-automatic-reference-counting-using-xcode-4-2-refactor/
I just switched my app over to ARC. The transition was a partial success thanks to the refactoring tool that Xcode provides. The one part that doesn't work is a strange error.
I used method swizzling (method_exchangeImplementations) so that instead of calling UIView's initWithFrame, it will call my myInitWithFrame code. The refactoring process threw an error at the method declaration of myInitWithFrame, so I added the __attribute__((objc_method_family(init))) after the declaration of the method. Now this all works perfectly fine for iOS 6.0 and above, but on iOS 5.0 (the lowest iOS I would like to support) it doesn't work. I'm getting an EXC_BAD_ACCESS (code=1, address=0X28). On every run the exact same memory address comes up.
I have a UIWebView that calls it's:
[[UIWebView alloc] initWithFrame:webViewFrame];
After the myInitWithFrame does it's initialization, it returns self, then it crashes.
On the thread trace, it says that it crashes in apples's code (the method is greyed out) on the [UIWebView retain] method, as seen below.
Thread 1, Queue : com.apple.main-thread
#0 0x3515a7d2 in -[UIWebView retain] ()
#1 0x316ddef4 in objc_retain ()
#2 0x0011528c in -[UIView(style) myInitWithFrame:]
Sorry that the thread trace isn't very well formatted, I don't have enough rep to post an image.
Is there any reason why the same code works for iOS 6.0, but not iOS 5.0?
This issue was very complicated to fix. The fact that this issue only showed up on iOS 5, and not iOS 6 was my first indication that this may be an apple issue, or an method swizzling issue. After about a week of searching I came to the consensus that I should email Apple technical support, to see if they could help me with this issue.
Their response was that it's both our faults. He said that in iOS 5 UIWebView keeps track of it's own retain count (using a UIWebViewInternal class), and that my method swizzling was retaining the object before it was fully initialized, and that caused the crash. When I didn't use ARC it wasn't an issue, because I never call retain in the init function, but with ARC it adds retains as it "sees" fit. He mentioned that in iOS 6 the UIWebViews don't manage their own retain count, and that's why it worked in iOS 6.