UIImage's resizableImageWithCapInsets brings multiple CoreGraphics "invalid context 0x0" errors under iOS 7 - uiimage

I've just noticed this issue with resizableImageWithCapInsets under iOS 7. Suddenly, I'm getting this error logs, but my app isn't crashing:
Oct 28 14:35:15 <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSetAlpha: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextGetCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextClipToRect: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextDrawTiledImage: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
And this is the code that's producing the error:
[_registerButton setBackgroundImage:[[UIImage imageNamed:#"image.png"] resizableImageWithCapInsets:(UIEdgeInsets){15, 15, 15, 15}]forState:UIControlStateNormal];
If I comment the line above, the error disappears. Has someone else experienced this error?

Found the issue. The "image.png" file was 30 pixels tall, so with top and bottom edgeInsets at 15, there was no empty space vertically speaking. It was working visually, but I was recieving those errors. I hope this will be useful for others.

Related

Run-time error ‘372’ – failed to load control ‘AdvGrid’ from AdvGridProj.ocx

Run-time error ‘372’ – failed to load control ‘AdvGrid’ from
AdvGridProj.ocx. Your version dkztexbox.ocx may be outdated. Make sure
you are using the version of the control that was provided with your
application.
on widows 7 and 10
how can solve it ?

Debugging the Abort crash with native crashlog on Android

In the play-store,
I am seeing one particular crash, which is being faced by a lot of users.
Crash-log has the following detail:
Title : “abort”
Detail:
pid: 0, tid: 0 >>> com.x.y <<< backtrace:
00 pc 0000000000081f74 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160)
01 pc 0000000000245ab0 /data/app/com.x.y-aYjDsZRe6QZhuGCy8Cef8A==/lib/arm64/libmonosgen-2.0.so
Crash is happening on the following android version:
Android 8.1, 9, 10 only.
For the lower versions,
It appears as “tgkill” in lower versions as per my understanding.
I am not able to reproduce such crash in my internal debugging/testing and this does not get caught by the crash-reporting tool either.
But this crash and its affected users constitute the significant %age of overall crashes reported on play-store.
In the crash-log, I noticed that pid and tid both are 0.
I am guessing that it might be that App is getting stuck (like an ANR) and OS is killing the application without giving option to user to wait.
Update:
90+% of the Crashes are coming from Android 10 only.
I searched a little and found that many other are facing this issue as well, but there is no one generic fix as i understand.
I am not able to reproduce the issue locally so far, so don't have a clue on what might be wrong.
Does anyone has any pointers on where to add more logs to get more details about the problem?

Xcode don't show stack of error

Hi im working with Xcode and swift3.
When I run the app, crash but in Xcode don't show me error:
If I want found the line when error is present, what i can do
Apple refers to this as an "Abnormal Exit" of your application. From the Apple documentation:
Abnormal Exit [EXC_CRASH // SIGABRT] - The process exited abnormally. The most common causes of crashes with this exception type are uncaught Objective-C/C++ exceptions and calls to abort().
App Extensions will be terminated with this exception type if they take too much time to initialize (a watchdog termination). If an extension is killed due to a hang at launch, the Exception Subtype of the generated crash report will be LAUNCH_HANG. Because extensions do not have a main function, any time spent initializing occurs within static constructors and +load methods present in your extension and dependent libraries. You should defer as much of this work as possible.
I have found that this is caused because of passing Foundation or UIKit an invalid parameter to do it's work under the hood. If I were you I would look into what could possibly be causing this by setting breakpoints where your application is having this crash and narrow down a culprit.

Can I get rid of Xcode's CGContextErase warning? [duplicate]

I keep getting this error:
Jan 31 13:56:51 Michaels-MacBook-Air.local CocoaDrawing[2129] <Error>: The function 'CGContextErase' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
My program doesn't call that method directly, and frustratingly, I can't find any documentation on this function.
This happens even with a blank (Cocoa) Xcode project. Why am I getting this error?
I had this problem. It was caused by an outdated Wacom Tablet driver. If you have such a driver installed I'd recommend removing it, then reinstalling a more recent driver. That did the trick for me.

Xcode 4: Can't use Enable Guard Malloc due to dylib error for iPad simulator

In Xcode 4.x I've edited my Run scheme to 'Enable Guard Malloc' since I have a nondescript malloc error I need to track down. I'm aware I need to run in the simulator to use this feature. However, when I do so the app immediately freezes and Xcode shows me a stack trace that looks like this:
I've googled around to find a solution, but thus far no joy. It was reported elsewhere that I should be setting an environment variable in my scheme:
DYLD_INSERT_LIBRARIES -> /usr/lib/libgmalloc.dylib
However this doesn't solve the problem. I have also tried 'lsystem' as the value, but that didn't work either.
Can anyone suggest a solution to this dylib issue, or perhaps recommend an alternative to 'Enable Guard Malloc' to identify where a malloc'd heap area is being exceeded?
UPDATE
To clarify, this is the type of error I'm dealing with:
malloc: *** error for object 0x2b4b54: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
I've tried setting a symbol breakpoint of malloc_error_break, however it still breaks 'randomly' upon memory issues rather than at the point of exceeding an allocated region.
To help with the debugging you can set MallocStackLogging, then when your App crashes, type this in the gdb console:
(gdb) info malloc-history 0x543216
Replace 0x543216 with the address of the object that caused the crash, and you will get a much more useful stack trace and it should help you pinpoint the exact line in your code that is causing the problem.
See this article for more detailed instructions.

Resources