[Openmcl-devel] 64bit drag and drop crash (was: HEMLOCK-LISTENER-FRAME (#x4060D0)> is not of the expected type CCL::STD-CLASS)
Alexander Repenning
ralex at cs.colorado.edu
Thu Sep 16 19:11:47 PDT 2010
On Sep 16, 2010, at 7:57 PM, Gary Byers wrote:
> I think that this means that the problem described in
>
> <http://trac.clozure.com/ccl/ticket/715>
>
> isn't just theoretical.
>
> I haven't been able to provoke a GC crash yet, but I can fairly
> reliably get the act of dragging some text around to generate a
> floating-point exception, deep in the code that drags the selected
> text around:
>
>
> (gdb) bt
> #0 0x00007fff83cd8882 in sseCGSBlackDeepMaskCopyARGB8888 ()
> #1 0x00007fff83712d4e in argb32_mark ()
> #2 0x00007fff829fa91d in ripl_BltGlyph ()
> #3 0x00007fff829f91c4 in ripc_RenderGlyphs ()
> #4 0x00007fff829f8877 in ripc_DrawGlyphs ()
> #5 0x00007fff83719f67 in draw_glyphs ()
> #6 0x00007fff8371986e in CGContextShowGlyphsWithAdvances ()
> #7 0x00007fff872b612b in -[NSLayoutManager(NSTextViewSupport) showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:] ()
> #8 0x00007fff872b5408 in -[NSLayoutManager(NSPrivate) _drawGlyphsForGlyphRange:atPoint:parameters:] ()
> #9 0x00007fff8769431a in -[NSTextView(NSDragging) dragImageForSelectionWithEvent:origin:] ()
> #10 0x00007fff87693725 in -[NSTextView(NSDragging) dragSelectionWithEvent:offset:slideBack:] ()
> #11 0x00007fff87350c42 in -[NSTextView mouseDown:] ()
> #12 0x000000000001b2cb in SPffcall () at ../x86-spentry64.s:4038
>
> and that ticket describes what would happen if the GC runs (because of activity
> in another thread) while we're processing that FP exception.
>
> This happens in code invoked from the (CALL-NEXT-METHOD EVENT) call
> near the end of the #/mouseDown: method on
> HEMLOCK-TEXTSTORAGE-TEXT-VIEW in ccl:cocoa-ide;cocoa-editor.lisp.
>
> If you change that to
>
> (let* ((mxcsr-control (ccl::%get-mxcsr-control)))
> (unwind-protect
> (progn
> (ccl::%set-mxcsr-control #x1f80)
> (call-next-method event)) ; <- original code
> (ccl::%set-mxcsr-control mxcsr-control)))
>
> and redefine the method, does dragging still lead to a GC crash ? (For me,
> it keeps the FP exceptions from being reported; the fact that Apple's code
> does a multiply on an infinity isn't really that interesting, though it's
> likely a bug in that code.)
works! No more crash. I did previously also get the floating point exception once in a while.
thanks, Alex
>
> Our handling of FP exceptions in foreign code changed (in the trunk) a few
> months ago. I think that the old code would have still reported the FP
> exception (and I don't know what the consequences of that would be), but
> the new code has a GC risk associated with it and I strongly suspect that
> that's what you're running into.
>
More information about the Openmcl-devel
mailing list