[Openmcl-devel] Re: [Bug-openmcl] NSViewHierarchyLock Assertion failure

Raffael Cavallaro raffaelcavallaro at mac.com
Wed May 12 09:54:54 PDT 2004


On May 12, 2004, at 11:33 AM, Gary Byers wrote:

> Does the problem remain if instead of doing:
>
> ? (tiny-setup)
>
> you do:
>
> ? (process-interrupt ccl::*cocoa-event-process* #'ccl::tiny-setup)
>
> (or otherwise arrange that everything that the window does happens
> on that thread) ?

Well this (process-interrupt ccl::*cocoa-event-process* #'animate) 
prevents me from closing the window at all. It also prevents me from 
entering a break in the IDE as well (i.e., control-c has no effect), 
and I'm forced to force-quit OpenMCL (Application Not Responding). The 
animation runs, but OpenMCL will not respond to any UI events, neither 
mouse nor keyboard.

Is there another way to ensure that all the drawing happens in that 
thread, while still allowing that thread (ccl::*cocoa-event-process*) 
to respond to UI events, such as mouse clicks, and keyboard input? The 
drawing takes place in a pretty tight loop which apparently monopolizes 
the *cocoa-event-process* thread entirely.

If I use process-run-function, I still get a crash on window close 
(unless I explicitly check for isVisible before each and every 
re-drawing, of course).

Here's a transcript including kernel debugger output:


Welcome to OpenMCL Version (Beta: Darwin) 0.14.2!
? (require 'tiny-loop)
TINY-LOOP
("FAKE-CFBUNDLE-PATH" "SPLAY-TREE" "NAME-TRANSLATION" 
"PROCESS-OBJC-MODULES" "OBJC-CLOS" "OBJC-RUNTIME" "BRIDGE" 
"OBJC-SUPPORT" "COCOA-WINDOW" "COCOA-EDITOR" "PTY" "COCOA-LISTENER" 
"COCOA" "TINY-LOOP")
? (process-run-function "animation-thread" #'animate)
#<PROCESS animation-thread(4) [Active] #x6E13536>

----- At this point, after the animation has run for 20 seconds or so, 
I close the drawing window --------

? Unhandled exception 11 at 0x936151a4, context->regs at #xf052e2f8
Read operation to unmapped address 0x00000026
  In foreign code at address 0x936151a4
? for help
[1610] OpenMCL kernel debugger: D
Read operation to unmapped address 0x00000026
[1610] OpenMCL kernel debugger: R
r00 = 0x91B82F98  r08 = 0x00000000  r16 = 0x06DE3606  r24 = 0x00000001
r01 = 0xF052E7E0  r09 = 0x00000000  r17 = 0x063995FE  r25 = 0x0015EC9C
r02 = 0x00000000  r10 = 0x936053C0  r18 = 0x063995A6  r26 = 0xF052E8B0
r03 = 0x0000001A  r11 = 0xA1B80210  r19 = 0x00002015  r27 = 0x001A6A60
r04 = 0x00000001  r12 = 0x93615198  r20 = 0x0639946E  r28 = 0x001A001A
r05 = 0x0015EC9C  r13 = 0x86081EA8  r21 = 0x06D4C48E  r29 = 0x0000001A
r06 = 0xF052E8B0  r14 = 0x06D4F214  r22 = 0x00000000  r30 = 0x0020001A
r07 = 0x86506000  r15 = 0x06D4F356  r23 = 0xF052E930  r31 = 0x91B82F0C

  PC = 0x936151A4   LR = 0x91B82F98  CTR = 0x93615198  CCR = 0x44802048
XER = 0x20000000  MSR = 0x0200F930  DAR = 0x00000026  DSISR = 0x40000000
[1610] OpenMCL kernel debugger: L
rcontext = 0x00000000 (INVALID)
[1610] OpenMCL kernel debugger: F
f00 : 0xC10FFFF800000000 (-262143.000000)
f01 : 0xFFFE123180000000 (nan)
f02 : 0x8000000000000000 (-0.000000)
f03 : 0x0000000000000000 (0.000000)
f04 : 0x43300000000003E8 (4503599627371496.000000)
f05 : 0x3FE921FB54442D19 (0.785398)
f06 : 0x3FE921FB54442D19 (0.785398)
f07 : 0xBF56C17817E8BF9A (-0.001389)
f08 : 0x3FF0000000000000 (1.000000)
f09 : 0x3FF0000000000000 (1.000000)
f10 : 0x3FF0000000000000 (1.000000)
f11 : 0x408F400000000000 (1000.000000)
f12 : 0x408F400000000000 (1000.000000)
f13 : 0x3FE921FB54442D19 (0.785398)
f14 : 0xC24BC19587859393 (-238423838475.152924)
f15 : 0xC24BC19587859393 (-238423838475.152924)
f16 : 0xC24BC19587859393 (-238423838475.152924)
f17 : 0xC24BC19587859393 (-238423838475.152924)
f18 : 0xC24BC19587859393 (-238423838475.152924)
f19 : 0xC24BC19587859393 (-238423838475.152924)
f20 : 0xC24BC19587859393 (-238423838475.152924)
f21 : 0xC24BC19587859393 (-238423838475.152924)
f22 : 0xC24BC19587859393 (-238423838475.152924)
f23 : 0xC24BC19587859393 (-238423838475.152924)
f24 : 0xC24BC19587859393 (-238423838475.152924)
f25 : 0xC24BC19587859393 (-238423838475.152924)
f26 : 0xC24BC19587859393 (-238423838475.152924)
f27 : 0xC24BC19587859393 (-238423838475.152924)
f28 : 0xC24BC19587859393 (-238423838475.152924)
f29 : 0xC24BC19587859393 (-238423838475.152924)
f30 : 0x4330000080000000 (4503601774854144.000000)
f31 : 0xFFFE123180000000 (nan)
FPSCR = 82000000
[1610] OpenMCL kernel debugger: B


(#xf052e7e0) #x91B82F44 : _ripc_GetColor + 80
(#xf052e870) #x91B84668 : _ripc_Render + 532
(#xf052e8f0) #x91B890A4 : _ripc_DrawPath + 528
(#xf052ea10) #x9360ADCC : _CGContextDrawPath + 192
(#xf052ea70) #x92E93AF4 : +[NSBezierPath strokeLineFromPoint:toPoint:] 
+ 176
(#xf052eac0) #x000053A8 : _SPffcall + 200
(#xF052EB00) #x06D4F214 : #<Function -[DemoView drawRect:] #x06d4f356> 
+ 4200
(#xf052eb10) #x00000000 : (null) + 0
(#xF052EB60) #x06D4F22C : #<Function -[DemoView drawRect:] #x06d4f356> 
+ 4224
(#xF052EB70) #x06D4ED24 : #<Function -[DemoView drawRect:] #x06d4f356> 
+ 2936
(#xF052EB80) #x06D4F2D4 : #<Function -[DemoView drawRect:] #x06d4f356> 
+ 4392
(#xF052EB90) #x00006C94 : (subprimitive _SPcallback)
(#xf052eba0) #x000053A8 : _SPffcall + 200
(#xF052EC60) #x06D5033C : #<Function DRAW-A-POLYGON #x06d505a6> + 592
(#xf052ec70) #x00000000 : (null) + 0
(#xF052ECC0) #x06D5034C : #<Function DRAW-A-POLYGON #x06d505a6> + 608
(#xF052ECD0) #x06D50144 : #<Function DRAW-A-POLYGON #x06d505a6> + 88
(#xF052ECE0) #x06D506E0 : #<Function LOOP-UP #x06d5071e> + 140
(#xF052ECF0) #x06D512DC : #<Function ANIMATE #x06d5132e> + 872
(#xF052ED00) #x020FD044 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 400
(#xF052ED10) #x020FD080 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 460
(#xF052ED20) #x020FD194 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 736
(#xF052ED30) #x00004D7C : (subprimitive _ret1valn)
(#xF052ED40) #x020FD314 : #<Anonymous Function #x06101d3e> + 152
(#xF052ED50) #x020FD2FC : #<Anonymous Function #x06101d3e> + 128
(#xF052ED60) #x020F5450 : #<Anonymous Function #x060f491e> + 172
(#xF052ED70) #x0000881C : (subprimitive toplevel_loop)
(#xF052ED80) #x00008828 : (subprimitive toplevel_loop)
(#xf052ed90) #x000088F4 : _start_lisp + 180
(#xf052ee50) #x00012CAC : _lisp_thread_entry + 152
(#xf052eeb0) #x900247E8 : __pthread_body + 40
(#xf052ef00) #x00000000 : (null) + 0


cstack area #x0017f3d0


(#xF03FBB20) #x020E1B4C : #<Function FD-INPUT-AVAILABLE-P #x060df146> + 
344
(#xF03FBB30) #x020E2004 : #<Function PROCESS-INPUT-WAIT #x060df676> + 
240
(#xF03FBB40) #x020E1370 : #<Function FD-STREAM-ADVANCE #x060dc5a6> + 460
(#xF03FBB50) #x020D94DC : #<Function %IOBLOCK-TYI #x060c6e0e> + 384
(#xF03FBB60) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBB70) #x020DFB60 : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060d7a26> + 204
(#xF03FBB80) #x020DFAF4 : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060d7a26> + 96
(#xF03FBB90) #x0210B1C4 : #<Function %NEXT-CHAR-AND-ATTR #x061105b6> + 
88
(#xF03FBBA0) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBBB0) #x0210B108 : #<Function %NEXT-NON-WHITESPACE-CHAR-AND-ATTR 
#x06110516> + 52
(#xF03FBBC0) #x02108724 : #<Function %READ-FORM #x0610e026> + 192
(#xF03FBBD0) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBBE0) #x02108DD8 : #<Function READ #x0610e52e> + 212
(#xF03FBBF0) #x020E5C4C : #<Method-Function READ-TOPLEVEL-FORM 
(INPUT-STREAM T) #x060e2f96> + 64
(#xF03FBC00) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBC10) #x020BBC64 : #<Function 
%%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE #x0608e21e> + 616
(#xF03FBC20) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBC30) #x020BC408 : #<Function %%STANDARD-COMBINED-METHOD-DCODE 
#x0608e88e> + 148
(#xF03FBC40) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBC50) #x00004CE0 : (subprimitive _nvalret)
(#xF03FBC60) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBC70) #x0210EA70 : #<Function READ-LOOP #x06116846> + 684
(#xF03FBC80) #x0210EB48 : #<Function READ-LOOP #x06116846> + 900
(#xF03FBC90) #x0210EB74 : #<Function READ-LOOP #x06116846> + 944
(#xF03FBCA0) #x0210EBA0 : #<Function READ-LOOP #x06116846> + 988
(#xF03FBCB0) #x0210F8E0 : #<Function TOPLEVEL-LOOP #x06117bde> + 44
(#xF03FBCC0) #x0210F8E8 : #<Function TOPLEVEL-LOOP #x06117bde> + 52
(#xF03FBCD0) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBCE0) #x021223EC : #<Anonymous Function #x0613f64e> + 592
(#xF03FBCF0) #x021221EC : #<Anonymous Function #x0613f64e> + 80
(#xF03FBD00) #x020FD044 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 400
(#xF03FBD10) #x020FD080 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 460
(#xF03FBD20) #x020FD194 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 736
(#xF03FBD30) #x00004D7C : (subprimitive _ret1valn)
(#xF03FBD40) #x020FD314 : #<Anonymous Function #x06101d3e> + 152
(#xF03FBD50) #x020FD2FC : #<Anonymous Function #x06101d3e> + 128
(#xF03FBD60) #x020F5450 : #<Anonymous Function #x060f491e> + 172
(#xF03FBD70) #x0000881C : (subprimitive toplevel_loop)
(#xF03FBD80) #x00008828 : (subprimitive toplevel_loop)
(#xf03fbd90) #x000088F4 : _start_lisp + 180
(#xf03fbe50) #x00012CAC : _lisp_thread_entry + 152
(#xf03fbeb0) #x900247E8 : __pthread_body + 40
(#xf03fbf00) #x00000000 : (null) + 0


cstack area #x00139ef0


(#xF0298CE0) #x020F6248 : #<Function %NANOSLEEP #x060f5946> + 268
(#xF0298CF0) #x06CC6B0C : #<Anonymous Function #x06cc6b4e> + 88
(#xF0298D00) #x020FD044 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 400
(#xF0298D10) #x020FD080 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 460
(#xF0298D20) #x020FD194 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 736
(#xF0298D30) #x00004D7C : (subprimitive _ret1valn)
(#xF0298D40) #x020FD314 : #<Anonymous Function #x06101d3e> + 152
(#xF0298D50) #x020FD2FC : #<Anonymous Function #x06101d3e> + 128
(#xF0298D60) #x020F5450 : #<Anonymous Function #x060f491e> + 172
(#xF0298D70) #x0000881C : (subprimitive toplevel_loop)
(#xF0298D80) #x00008828 : (subprimitive toplevel_loop)
(#xf0298d90) #x000088F4 : _start_lisp + 180
(#xf0298e50) #x00012CAC : _lisp_thread_entry + 152
(#xf0298eb0) #x900247E8 : __pthread_body + 40
(#xf0298f00) #x00000000 : (null) + 0


cstack area #x00104050


(#xF0135B10) #x020E1B4C : #<Function FD-INPUT-AVAILABLE-P #x060df146> + 
344
(#xF0135B20) #x020E2004 : #<Function PROCESS-INPUT-WAIT #x060df676> + 
240
(#xF0135B30) #x020E1370 : #<Function FD-STREAM-ADVANCE #x060dc5a6> + 460
(#xF0135B40) #x020D94DC : #<Function %IOBLOCK-TYI #x060c6e0e> + 384
(#xF0135B50) #x00004D7C : (subprimitive _ret1valn)
(#xF0135B60) #x020DFB60 : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060d7a26> + 204
(#xF0135B70) #x020DFAF4 : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060d7a26> + 96
(#xF0135B80) #x0210B1C4 : #<Function %NEXT-CHAR-AND-ATTR #x061105b6> + 
88
(#xF0135B90) #x00004D7C : (subprimitive _ret1valn)
(#xF0135BA0) #x0210B108 : #<Function %NEXT-NON-WHITESPACE-CHAR-AND-ATTR 
#x06110516> + 52
(#xF0135BB0) #x02108724 : #<Function %READ-FORM #x0610e026> + 192
(#xF0135BC0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135BD0) #x02108DD8 : #<Function READ #x0610e52e> + 212
(#xF0135BE0) #x020E5C4C : #<Method-Function READ-TOPLEVEL-FORM 
(INPUT-STREAM T) #x060e2f96> + 64
(#xF0135BF0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C00) #x020BBC64 : #<Function 
%%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE #x0608e21e> + 616
(#xF0135C10) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C20) #x020BC408 : #<Function %%STANDARD-COMBINED-METHOD-DCODE 
#x0608e88e> + 148
(#xF0135C30) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C40) #x00004CE0 : (subprimitive _nvalret)
(#xF0135C50) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C60) #x0210EA70 : #<Function READ-LOOP #x06116846> + 684
(#xF0135C70) #x0210EB48 : #<Function READ-LOOP #x06116846> + 900
(#xF0135C80) #x0210EB74 : #<Function READ-LOOP #x06116846> + 944
(#xF0135C90) #x0210EBA0 : #<Function READ-LOOP #x06116846> + 988
(#xF0135CA0) #x0210F8E0 : #<Function TOPLEVEL-LOOP #x06117bde> + 44
(#xF0135CB0) #x0210F8E8 : #<Function TOPLEVEL-LOOP #x06117bde> + 52
(#xF0135CC0) #x020F8720 : #<Anonymous Function #x060f8b36> + 68
(#xF0135CD0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135CE0) #x021223EC : #<Anonymous Function #x0613f64e> + 592
(#xF0135CF0) #x021221EC : #<Anonymous Function #x0613f64e> + 80
(#xF0135D00) #x020FD044 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 400
(#xF0135D10) #x020FD080 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 460
(#xF0135D20) #x020FD194 : #<Function RUN-PROCESS-INITIAL-FORM 
#x06101c0e> + 736
(#xF0135D30) #x00004D7C : (subprimitive _ret1valn)
(#xF0135D40) #x020FD314 : #<Anonymous Function #x06101d3e> + 152
(#xF0135D50) #x020FD2FC : #<Anonymous Function #x06101d3e> + 128
(#xF0135D60) #x020F5450 : #<Anonymous Function #x060f491e> + 172
(#xF0135D70) #x0000881C : (subprimitive toplevel_loop)
(#xF0135D80) #x00008828 : (subprimitive toplevel_loop)
(#xf0135d90) #x000088F4 : _start_lisp + 180
(#xf0135e50) #x00012CAC : _lisp_thread_entry + 152
(#xf0135eb0) #x900247E8 : __pthread_body + 40
(#xf0135f00) #x00000000 : (null) + 0


cstack area #x00100610


(#xBFFFF8F0) #x06CC5398 : #<Function RUN-EVENT-LOOP #x06cc565e> + 532
(#xbffff900) #x00000000 : (null) + 0
(#xBFFFF950) #x06CC53A8 : #<Function RUN-EVENT-LOOP #x06cc565e> + 548
(#xBFFFF960) #x06CC5260 : #<Function RUN-EVENT-LOOP #x06cc565e> + 220
(#xBFFFF970) #x06CC53D8 : #<Function RUN-EVENT-LOOP #x06cc565e> + 596
(#xBFFFF980) #x0000881C : (subprimitive toplevel_loop)
(#xBFFFF990) #x00008828 : (subprimitive toplevel_loop)
(#xbffff9a0) #x000088F4 : _start_lisp + 180
[1610] OpenMCL kernel debugger: K
Killed

If this would be any clearer, I could send you the complete code to 
tiny-loop.lisp - it's only a dozen lines longer than tiny.lisp.

Thanks for all your efforts,

Ralph


Raffael Cavallaro, Ph.D.
raffaelcavallaro at mac.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 13995 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20040512/783c47d0/attachment.bin>


More information about the Openmcl-devel mailing list