0

this's a log which I get when close window in my application:

Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Warning>: _CGSReferenceWindowByID: Window id 0xffffffff not found (locally or shared)
Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Error>: Failed to create window context device
Nov 21 20:58:17 Mac-mini.local FirstGUIapp[3255] <Error>: CGWindowContextCreate: failed to create window context delegate.
2011-11-21 20:58:17.307 FirstGUIapp[3255:403] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0xefef, window:0xffffffff

Everything works fine until I close application: when it enters into applicationWillTerminate method these messages appear in log and app crashes.

I just open and close application, no code executes after launching

I don't know if it matter, but I have also Clipped Content warning in MainMenu.xib (at push button)

Thanks

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Ilya Blokh
  • 11,923
  • 11
  • 52
  • 84
  • Did you set a breakpoint at `CGErrorBreakpoint` like the log suggested? – trojanfoe Nov 21 '11 at 15:38
  • I don't know what does it mean, I have nothing like `CGErrorBreakpoint` in code. I commented all code in `applicationDidFinishLaunching`, so between launching and finishing no code executes. I suspect that clipped content warning is related to the problem – Ilya Blokh Nov 21 '11 at 15:46
  • @IlyaBlokh: Use “Add Symbolic Breakpoint” in Xcode's Breakpoints Navigator to add a breakpoint on `CGErrorBreakpoint`. It's a function in Core Graphics that exists specifically for you to be able to set a breakpoint on, for circumstances like this. – Peter Hosey Nov 21 '11 at 17:28
  • I added a breakpoint, so it stops on the line with `return NSApplicationMain(argc, (const char **)argv);` in `main` function. However it's not clear what to do next and where look for something useful – Ilya Blokh Nov 21 '11 at 18:13
  • @IlyaBlokh: Did you add a breakpoint on `CGErrorBreakpoint`, or did you just set it somewhere in your source code? You need to create a symbolic breakpoint on that function specifically for it to stop at the right place. – Peter Hosey Nov 21 '11 at 18:48
  • I created a symbolic breakpoint on `CGErrorBreakpoint`. I see now that this function invokes 2 times: first two lines in log appears before first time breakpoint achieved, second two lines - before second time, last lines - after. – Ilya Blokh Nov 21 '11 at 18:58
  • So what is the application doing at the times when `CGErrorBreakpoint` is tripped? – Peter Hosey Nov 21 '11 at 19:51
  • There're several threads in Debug navigator, `CGErrorBreakpoint` is inside first one. When I click it, I see several commands on language like assembly. Other items in thread 1 are: `NSApplicationMain`, `main` (with `return NSApplicationMain(argc, (const char **)argv);`) and `start`. In the console there're first and second records(see in my post). I don't know how use this information to understand why error occurs( What can you advise? – Ilya Blokh Nov 21 '11 at 20:49
  • So I just made rollback to previous version of my application. The issue didn't appear again – Ilya Blokh Dec 01 '11 at 15:56

1 Answers1

0

It seems your windows ptr is equal 0xFFFFFFFF which is most probaly a bad sign, do you have the source of applicationWillTerminate? Are you trying to access to the windows in any way ?

deksan
  • 56
  • 3