CFileDialog delayed crashing

2

I have added an "Open file" dialog to my dialog-based MFC application. Now, exactly one minute(!) after an open file dialog is closed by pushing either Open or Cancel button my application crashes. While it crashes, the following things are happening in the output:

1) a bunch of Windows threads are exiting;

2) a bunch of COM exceptions (of 0x80010108 "the object invoked has disconnected from its clients" and 0x800401FD "Object is not connected to server" variety) are being thrown;

3) finally, an unhandled exception occurs: 0xC0000005: Access violation reading location 0xfeeefeee, with call stack pointing to ole32.dll.

To say that I am bewildered is quite an understatement. The code for invoking the dialog is as follows:

CFileDialog fileDlg( TRUE, _T(".txt"), NULL, OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, 
                     _T("Text file (*.txt)|*.txt||"), this);
INT_PTR res = fileDlg.DoModal();

What could cause such a thing?

How do I even debug it?

c++
windows
mfc
asked on Stack Overflow Sep 12, 2012 by obamator

1 Answer

3

I had this exact issue in Windows 7 x64, and by enabling breakpoints on all Win32 exceptions not already chosen (in the VS2015 exceptions tab), I was able to narrow it down to a known issue with fundisc.dll that was resolved with an optional Hotfix from Microsoft: https://support.microsoft.com/en-us/kb/2494427

It also resolved issues on my PC of File Explorer windows crashing at seemingly random times. All were caused by some deadlock in the networking COM objects that is fixed by that hotfix.

answered on Stack Overflow Sep 27, 2016 by TaliesinToo

User contributions licensed under CC BY-SA 3.0