Issue 126629 - aoo suddenly crashes on win7 - incorrect call of "dwmapi.dll" in "salframe.cxx"
Summary: aoo suddenly crashes on win7 - incorrect call of "dwmapi.dll" in "salframe.cxx"
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.0.1
Hardware: PC Windows 7
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: crash, data_loss
Depends on:
Blocks:
 
Reported: 2015-11-05 11:06 UTC by Oliver Brinzing
Modified: 2017-05-20 11:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.2
Developer Difficulty: Simple


Attachments
correct call (27.33 KB, image/png)
2015-11-05 11:06 UTC, Oliver Brinzing
no flags Details
incorrect call (30.90 KB, image/png)
2015-11-05 11:06 UTC, Oliver Brinzing
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Oliver Brinzing 2015-11-05 11:06:25 UTC
Created attachment 85107 [details]
correct call

first noticed with aoo 4.0.1

\main\vcl\win\source\window\salframe.cxx:

static BOOL ImplDwmIsCompositionEnabled()
{
    SalData* pSalData = GetSalData();
    if( ! pSalData->mpDwmIsCompositionEnabled )
    {
        pSalData->maDwmLib = osl_loadAsciiModule( "Dwmapi.dll", SAL_LOADMODULE_DEFAULT );
        if( pSalData->maDwmLib )
            pSalData->mpDwmIsCompositionEnabled = 
			(DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
        if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
            pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
    }
    BOOL aResult = FALSE;
    HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
    return nError == S_OK && aResult;
}

"pSalData->mpDwmIsCompositionEnabled" is initialized only the first time
ImplDwmIsCompositionEnabled() is called.
but ImplDwmIsCompositionEnabled() is called periodically (e.g. window events
from other programs).

for whatever reason sometimes the "pSalData->mpDwmIsCompositionEnabled" pointer gets 
corrupted, and a call causes aoo to crash.

attached "ImplDwmIsCompositionEnabled_1.png" shows a correct call while 
ImplDwmIsCompositionEnabled_2.png shows a corrupted one.

updating "dwmapi.dll" with "KB3078667" https://support.microsoft.com/en-us/kb/3078667
will not solve the problem.

btw: if aoo runs with xp compatibility settings, it will not crash.
Comment 1 Oliver Brinzing 2015-11-05 11:06:58 UTC
Created attachment 85108 [details]
incorrect call
Comment 2 Oliver Brinzing 2015-11-05 11:07:58 UTC
adding keywords