Error Message in Debug Area

With every playground that runs in Xcode 7.0 beta 5, the following three errors display in the debug area:

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.


How do I fix this? How do I set the environmental variables and what do I set them to?

Replies

Hello, klmg, You are not the only one. This popped up in my Xcode 7.0 beta 5 project as well. Please file a bug report and share the number here. Thank you.

I have the same issue after upgrading to Xcode 7 Beta 5.

Hi,


same problem here.

Playground with OS X target is working for me

Same problem


Greg

OK, I filed a bug report. Here is the number: 22199876

See it to, on iOS, not OSX.


Also, in the console, when the playground executes, it spews out:


8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

8/7/15 9:15:30.000 PM kernel[0]: Sandbox: MyPlayground(45970) deny ipc-posix-shm-read-data apple.sim.cfprefsd.daemon

Hello, klmg, Thank you very much. As you know, this is not for me, but Apple wanted us to share these Bug report IDs in the forum to better track these issues ;-) Kind regards.

This is a known issue when running iOS playgrounds, thank you for your bug reports!

This is happening in some of my iOS probjects too, not just playgrounds.

Indeed, the root cause of the error messages is an issue with iOS.

This seems to still occur in Xcode 7 Beta 6

I do use status bar type, which is hidden in my project. After I comment it out, I still get this error.

I got the same problem, it seems to be the problem on iOS9 Beta 5. I use Xcode 7 beta 6 to run against iOS8 and it is fine.

Same here, also with a non-playground project that compiles fine on iOS8

BACKTRACE:

Sep 1 16:50:04 WorkAids2[1627] <Error>: CGContextSaveGState: invalid context 0x0. Backtrace:

<<redacted>+34>

<<redacted>+398>

<<redacted>+120>

<<redacted>+142>

<<redacted>+318>

<<redacted>+82>

<<redacted>+770>

<<redacted>+842>

<<redacted>+352>

<<redacted>+72>

<<redacted>+788>

<<redacted>+328>

<<redacted>+400>

<<redacted>+96>

<<redacted>+90>

<<redacted>+278>

<<redacted>+502>

<<redacted>+426>

<<redacted>+1606>

<<redacted>+30>

<<redacted>+240>

<<redacted>+286>

<<redacted>+858>

<<redacted>+36>

<<redacted>+134>

<<redacted>+232>

<<redacted>+44>

<<redacted>+14>

<<redacted>+454>

<<redacted>+806>

<CFRunLoopRunSpecific+516>

<CFRunLoopRunInMode+108>

<<redacted>+526>

<UIApplicationMain+144>

<main+108>

mmmnnn very helpful...