Window manager crashes when I run the program I'm making. How do I debug?

Joined
Jun 24, 2008
Messages
196
Reaction score
1
Points
18
Your Mac's Specs
Macbook White 2.13Ghz 160GB 10.6.4 (Buggy Version :() Snow Leopard
Hello, I'm making a program which uses OpenGL, Python and Cocoa with PyObjC. I've made an additional part to my program which uses the same graphical code as everything else. When using it, the window manager crashes. It happens at two places. At one place, the fps drops rapidly before the crash happens. The other place has no fps drop noticeable; it simply crashes the window manager.

I have no idea how to debug this because all I have is an error report.

Can anyone make sense of the error report? (Same on each occasion) I believe it's a common problem in Snow Leopard 10.6.4 but nowhere I go explains what causes it and hence how to avoid it.

Thank you.

One of the error reports (Removed end to fit into post).

Code:
Process:         WindowServer [1009]
Path:            /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/WindowServer
Identifier:      WindowServer
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [1]

Date/Time:       2010-08-04 16:45:14.185 +0100
OS Version:      Mac OS X 10.6.4 (10F569)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.GeForceGLDriver     	0x00000002000119a4 gldAttachDrawable + 2388
1   com.apple.GeForceGLDriver     	0x00000002000ce0c5 gldUpdateDispatch + 14581
2   com.apple.GeForceGLDriver     	0x00000002000ce1b6 gldUpdateDispatch + 14822
3   GLEngine                      	0x000000011291f146 glFlush_Exec + 133
4   com.apple.CoreGraphics        	0x00007fff802bc177 CGXGLAccelFinish + 154
5   com.apple.CoreGraphics        	0x00007fff802bb2e0 CGXReleaseDisplayDeviceSurface + 232
6   com.apple.CoreGraphics        	0x00007fff80469c02 CGXRedrawSpecifiedWindowsToDisplayAndRegion + 3663
7   com.apple.CoreGraphics        	0x00007fff802afb42 CGXUpdateMagicMirror + 641
8   com.apple.CoreGraphics        	0x00007fff8029092e CGXUpdateDisplay + 1308
9   com.apple.CoreGraphics        	0x00007fff8045cbc2 CGXFlushSurface + 732
10  com.apple.CoreGraphics        	0x00007fff8048440d _CGXFlushSurfaceInline + 231
11  com.apple.CoreGraphics        	0x00007fff803f366c _XFlushSurfaceInline + 205
12  com.apple.CoreGraphics        	0x00007fff802c31cd CGXServices_server + 108
13  com.apple.CoreGraphics        	0x00007fff802c2e8a connectionHandler + 220
14  com.apple.CoreGraphics        	0x00007fff802a4f2d CGXPostPortData + 175
15  com.apple.CoreGraphics        	0x00007fff802a4d37 CGXRunOneServerPass + 451
16  com.apple.CoreGraphics        	0x00007fff802a1e4d CGXRunOneServicesPass + 672
17  com.apple.CoreGraphics        	0x00007fff802aad4a CGXServerLoop + 139
18  com.apple.CoreGraphics        	0x00007fff80275856 CGXGetRootAdminCredentials + 0
19  WindowServer                  	0x0000000100000f29 main + 9
20  WindowServer                  	0x0000000100000f18 start + 52

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib             	0x00007fff88c7408a kevent + 10
1   libSystem.B.dylib             	0x00007fff88c75f5d _dispatch_mgr_invoke + 154
2   libSystem.B.dylib             	0x00007fff88c75c34 _dispatch_queue_invoke + 185
3   libSystem.B.dylib             	0x00007fff88c7575e _dispatch_worker_thread2 + 252
4   libSystem.B.dylib             	0x00007fff88c75088 _pthread_wqthread + 353
5   libSystem.B.dylib             	0x00007fff88c74f25 start_wqthread + 13

Thread 2:
0   libSystem.B.dylib             	0x00007fff88c5b2fa mach_msg_trap + 10
1   libSystem.B.dylib             	0x00007fff88c5b96d mach_msg + 59
2   com.apple.CoreFoundation      	0x00007fff846173c2 __CFRunLoopRun + 1698
3   com.apple.CoreFoundation      	0x00007fff8461684f CFRunLoopRunSpecific + 575
4   com.apple.CoreFoundation      	0x00007fff846165d6 CFRunLoopRun + 70
5   com.apple.CoreGraphics        	0x00007fff8028773e eventThread + 470
6   libSystem.B.dylib             	0x00007fff88c94456 _pthread_start + 331
7   libSystem.B.dylib             	0x00007fff88c94309 thread_start + 13

Thread 3:
0   libSystem.B.dylib             	0x00007fff88c5b2fa mach_msg_trap + 10
1   libSystem.B.dylib             	0x00007fff88c5b96d mach_msg + 59
2   com.apple.QuartzCore          	0x00007fff8317abe2 CA::Render::Server::server_thread(void*) + 177
3   com.apple.QuartzCore          	0x00007fff8317ab22 thread_fun + 34
4   libSystem.B.dylib             	0x00007fff88c94456 _pthread_start + 331
5   libSystem.B.dylib             	0x00007fff88c94309 thread_start + 13

Thread 4:
0   libSystem.B.dylib             	0x00007fff88c95eb6 __semwait_signal + 10
1   libSystem.B.dylib             	0x00007fff88c99cd1 _pthread_cond_wait + 1286
2   com.apple.CoreGraphics        	0x00007fff8036082a layer_blit_work_queue_thread + 714
3   com.apple.CoreGraphics        	0x00007fff80360a9c layer_blit_work_queue_server + 156
4   libSystem.B.dylib             	0x00007fff88c94456 _pthread_start + 331
5   libSystem.B.dylib             	0x00007fff88c94309 thread_start + 13

Thread 5:
0   libSystem.B.dylib             	0x00007fff88c74eaa __workq_kernreturn + 10
1   libSystem.B.dylib             	0x00007fff88c752bc _pthread_wqthread + 917
2   libSystem.B.dylib             	0x00007fff88c74f25 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00000000e00002c2  rbx: 0x0000000112f65000  rcx: 0x00007fff88c5b2fa  rdx: 0x0000000012fa8000
  rdi: 0x00007fff5fbed310  rsi: 0x00007fff711475c0  rbp: 0x00007fff5fbee4a0  rsp: 0x00007fff5fbee4a0
   r8: 0x0000000000000e03   r9: 0x0000000000000000  r10: 0x00000000000010bc  r11: 0x0000000000000206
  r12: 0x0000000112fa8000  r13: 0x0000000000000003  r14: 0x00007fff5fbee4d0  r15: 0x00000001003f48d0
  rip: 0x00000002000119a4  rfl: 0x0000000000010246  cr2: 0x0000000000000000
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
"How do I debug?"

The old fashioned way. Get a clue where the crash is occurring. Only you can do that. Place some printf's in the code to narrow it down or step through the area of the code where you think the crash is happening.

That zero address looks suspicious. Perhaps you are passing an zero initialized variable that is suppose to be a call back function pointer. Can't say I know though.
 
OP
god0fgod
Joined
Jun 24, 2008
Messages
196
Reaction score
1
Points
18
Your Mac's Specs
Macbook White 2.13Ghz 160GB 10.6.4 (Buggy Version :() Snow Leopard
This happens with my python code but my new python code could be passing values to my C++ or Objective-C code which could be problematic in certain conditions.

The problem is, the Terminal will crash. I'll have to print everything with NSLog so I can see things in the Console, afterwards.

Thank you for your answer. I suppose the hard way is the only way unless I can gather more details on the cause of the error.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top