Bug 57517 - vcl: mac progress bar rendering infinite recursion
Summary: vcl: mac progress bar rendering infinite recursion
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: Other All
: medium normal
Assignee: Not Assigned
Keywords: regression
Depends on:
Reported: 2012-11-25 12:56 UTC by Michael Meeks
Modified: 2012-12-18 14:42 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-11-25 12:56:21 UTC
Installing a Java extension on a master snapshot on mac gives rather a fun infinite recursion crash:

... lots of same ...
... loop etc. until crash.

Reading the code it is amazing that we have:

        bool bNeedErase = ImplGetSVData()->maNWFData.mbProgressNeedsErase;

        if( bNeedErase )
            Window* pEraseWindow = pWindow;
            while( pEraseWindow->IsPaintTransparent()                         &&
                   ! pEraseWindow->ImplGetWindowImpl()->mbFrame )
                pEraseWindow = pEraseWindow->ImplGetWindowImpl()->mpParent;
            if( pEraseWindow == pWindow )
                // restore background of pWindow
                pEraseWindow->Erase( rFramePosSize );
                // restore transparent background
                Point aTL( pWindow->OutputToAbsoluteScreenPixel( rFramePosSize.TopLeft() ) );
                aTL = pEraseWindow->AbsoluteScreenToOutputPixel( aTL );
                Rectangle aRect( aTL, rFramePosSize.GetSize() );
                pEraseWindow->Invalidate( aRect, INVALIDATE_NOCHILDREN     |
                                                 INVALIDATE_NOCLIPCHILDREN |
                                                 INVALIDATE_TRANSPARENT );
            pWindow->Push( PUSH_CLIPREGION );
            pWindow->IntersectClipRegion( rFramePosSize );

So - I think the '// restore transparent background' section is totally bonkers.

How can that ever have worked ? I can only conclude that it didn't and that this path was not called.

Comparing with similar code in button.cxx:

void CheckBox::ImplInvalidateOrDrawCheckBoxState()
    if( ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase )

Similar erase / invalidation is done but never in the paint method itself.
Comment 1 Stephan Bergmann 2012-11-27 10:36:42 UTC
FYI, I cannot reproduce with my own recent master builds on a Mac OS X 10.7 box.
Comment 2 Michael Meeks 2012-11-27 11:04:54 UTC
Thanks Stephan - perhaps it depends on theme or something (?) I assume the issue is:

            while( pEraseWindow->IsPaintTransparent()

is set on the window but only in some corner cases - but - perhaps I'm wrong.

I can't see a way not to hit the recursion otherwise if we make it to that path :-)
Comment 3 Michael Meeks 2012-11-27 11:40:25 UTC
Caolan, there is some thought it might be related to:

Thorsten - it was your mac that this reproduced on - can you help sub-set the problem ? Neither Norbert nor Stephan can reproduce it.
Comment 4 Thorsten Behrens (allotropia) 2012-11-28 08:56:18 UTC
Can't easily build on that box, and currently blocked on bluetooth impl - gladly try any available test binaries though.
Comment 5 Caolán McNamara 2012-11-28 13:15:09 UTC
I had a mac build that crashed on installing an extension, re-pulled and rebuilt and it doesn't crash for me now. There have been two follow up commits to that make-containers-transparent thing (if its related)
Comment 6 Michael Meeks 2012-12-05 12:21:23 UTC
So - nominally fixed; though I can't see how that mac code path could ever work personally ;-) it'd be nice to verify that on your machine Thorsten with a 4.0 beta build / download as/when :-)