A couple of users have reported getting quite some (sometimes a lot, like 
hundreds or thousands) logging errors coming from my application (OS X). The 
logs state something like this:

 
: CGContextRotateCTM: 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.


The functions causing the problems are different though. Users got examples of 
CGContextSetFillColorWithColor(), CGContextSetStrokeColorWithColor(), 
CGContextScaleCTM(), CGContextConcatCTM(), CGContextGetCTM(), 
CGContextRestoreGState() and others.
 
I don't use any of those functions in my code directly, all the drawing is done 
using Cocoa, so I suppose Cocoa methods are calling those CG functions under 
the hood. I also took care of saving and restoring the current graphics context 
wherever necessary. On top of it all, these happen only with few users (who 
reported the problem, there are probably some more), but certainly not with 
all. I'd definitely know if it's a common problem, since the application user 
base is measured with a six-digit number.
 
I don't have this problem myself so I set symbolic breakpoints in order to try 
to track it down, but it didn't really work, as those functions are being 
called way too often to give me any hint where the problem could be.
 
Perhaps a useful information is while people are getting those messages, 
there's nothing really wrong with the way application draws its UI. Everything 
looks normal.
 
I also tried searching mail list archive for similar issues, and while I found 
some discussions, they weren't quite relevant, as people had particular test 
cases where the issue was 100% reproducible (and many times the problem was in 
the API itself), or it was related to bugs in iOS.
 
Does anyone know what could be causing this problem in such a way that it 
doesn't happen to all, but only to some people? Is it possible to get the 
graphics context completely screwed so that those messages start popping-up?

-- Dragan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to