Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Crash on exit Collapse All
Subject Author Date
Ian McIntosh Jun 13, 2007 - 4:48 PM

I am getting a crash on exit with call stack as below. The crash occurs maybe one time in 3.

I have an MDI app with a ribbon bar

any suggestions?

call stack:
>    ProfUIS264md.dll!CArray<CExtHookSink *,CExtHookSink *>::GetSize() Line 279 + 0x11 bytes    C++
    ProfUIS264md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=130, unsigned int & wParam=0, long & lParam=0) Line 239 + 0xb bytes    C++
    ProfUIS264md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00162138, unsigned int nMessage=130, unsigned int wParam=0, long lParam=0) Line 287 + 0x14 bytes    C++
    user32.dll!7e418734()     
    [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]    
    user32.dll!7e41d05b()     
    user32.dll!7e41b4c0()     
    user32.dll!7e41dabd()     
    ntdll.dll!7c90eae3()     
    user32.dll!7e41daf6()     
    mfc80d.dll!CWnd::DestroyWindow() Line 993 + 0xd bytes    C++
    GuiMdi.exe!CMainFrame::DestroyWindow() Line 660 + 0x8 bytes    C++

Ian McIntosh Jun 17, 2007 - 9:18 AM

Adding the suggested line causes ASSERT failures elsewhere in the project (call stack listed below).

The project has quite a few dlls and does quite a bit of module state switching.
Each dll has its own mfc dialogs and resource files. They all use prof-UIS based controls.

It may be helpful if you can give me more info on module state control within prof-UIS.
for example, do I need to do anything in prof-UIS when I call AFX_MANAGE_STATE?

call stack on assert:

>    ProfUIS270md.dll!CExtResDlg::Create(const char * lpszTemplateName=0x0000138b, CWnd * pParentWnd=0x037716b8) Line 5932 + 0x19 bytes    C++
    ProfUIS270md.dll!CExtResDlg::Create(unsigned int nIDTemplate=5003, CWnd * pParentWnd=0x037716b8) Line 5948 + 0x1b bytes    C++
    CobraUtils.dll!CCobraDialog::Create(unsigned int idd=5003, CWnd * pParent=0x037716b8) Line 17 + 0x19 bytes    C++
    Z2015.cbr!CGZ2015ControlDlg::Create(CWnd * pParent=0x037716b8) Line 69 + 0x14 bytes    C++
    Z2015.cbr!CGZ2015Plugin::CreateAllDialogs() Line 243    C++
    CobraUtils.dll!CPlugin::InitPlugin(CWnd * pSystemWnd=0x03766e30, bool bIsGui=true, CMessageHub * pMessageHub=0x0377109c) Line 139 + 0x12 bytes    C++
    Z2015.cbr!CZ2015Plugin::InitPlugin(CWnd * pSystemWnd=0x03766e30, bool isGui=true, CMessageHub * pMessageHub=0x0377109c) Line 103 + 0x17 bytes    C++
    Z2015.cbr!CZ2015App::InitPlugin(CWnd * pSystemWnd=0x03766e30, bool bIsGui=true, CMessageHub * pMessageHub=0x0377109c) Line 74 + 0x2c bytes    C++
    Z2015.cbr!fnInitPlugin(CWnd * SystemWnd=0x03766e30, int isGUI=1, CMessageHub * pMessageHub=0x0377109c) Line 94 + 0x1a bytes    C++
    CobraDllManager.dll!CDllManager::Initialise(ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > & PluginExtension="*.cbr", ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > & PluginName="", int isGUI=1) Line 233 + 0x38 bytes    C++
    CobraDllManager.dll!CDllManager::CDllManager(HINSTANCE__ * hAppMod=0x00400000, CMessagingAPI * pMainWnd=0x03769898, CWnd * pParent=0x03766e30, ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > & PluginExtension="*.cbr", ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > & PluginName="", int isGUI=1) Line 88    C++
    GuiMdi.exe!CSystemGui::Init(CWnd * pAppWnd=0x03766e30, boost::shared_ptr<IPopupMgt> & spPopupMgt={...}, boost::shared_ptr<IGui> & spIGui={...}) Line 159 + 0xda bytes    C++
    GuiMdi.exe!CGuiLogic::StartCore() Line 127    C++
    GuiMdi.exe!CMainFrame::OnStartup(unsigned int __formal=0, unsigned int __formal=0) Line 761    C++
    mfc80d.dll!CWnd::OnWndMsg(unsigned int message=32869, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f9c0) Line 2004 + 0x11 bytes    C++
    GuiMdi.exe!CMainFrame::OnWndMsg(unsigned int message=32869, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f9c0) Line 818    C++
    mfc80d.dll!CWnd::WindowProc(unsigned int message=32869, unsigned int wParam=0, long lParam=0) Line 1741 + 0x20 bytes    C++
    GuiMdi.exe!CExtNCW<CMDIFrameWnd>::WindowProc(unsigned int message=32869, unsigned int wParam=0, long lParam=0) Line 535 + 0x14 bytes    C++
    mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x036dc010, HWND__ * hWnd=0x00021522, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes    C++
    mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00021522, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 389    C++
    mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00021522, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 411 + 0x15 bytes    C++
    user32.dll!7e418734()     
    [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]    
    user32.dll!7e418816()     
    user32.dll!7e41c63f()     
    user32.dll!7e41f65d()     
    ProfUIS270md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=32869, unsigned int & wParam=0, long & lParam=0) Line 236 + 0x20 bytes    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00021522, unsigned int nMessage=32869, unsigned int wParam=0, long lParam=0) Line 300 + 0x14 bytes    C++
    user32.dll!7e418734()     
    user32.dll!7e418816()     
    user32.dll!7e4189cd()     
    user32.dll!7e4196c7()     
    mfc80d.dll!AfxInternalPumpMessage() Line 183    C++
    mfc80d.dll!CWinThread::PumpMessage() Line 896    C++
    mfc80d.dll!CWinThread::Run() Line 625 + 0xd bytes    C++
    mfc80d.dll!CWinApp::Run() Line 894    C++
    mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f11, int nCmdShow=1) Line 47 + 0xd bytes    C++
    GuiMdi.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f11, int nCmdShow=1) Line 33    C++
    GuiMdi.exe!__tmainCRTStartup() Line 589 + 0x35 bytes    C
    GuiMdi.exe!WinMainCRTStartup() Line 414    C
    kernel32.dll!7c816fd7()     
    GuiMdi.exe!AfxWinMain() + 0x1c35b bytes    C++
    GuiMdi.exe!AfxWinMain() + 0x1c31a bytes    C++
    ffeb5983()    

Ian McIntosh Jun 14, 2007 - 12:52 PM


problem seems to be in:

bool CExtTabPageContainerWnd::OnHookWndMsg(
    LRESULT & lResult,
    HWND hWndHooked,
    UINT nMessage,
    WPARAM & wParam,
    LPARAM & lParam
    )
{
    __PROF_UIS_MANAGE_STATE;

    ASSERT_VALID( this );

...
    
}

It is the ASSERT_VALID(this) that is failing.
As a get-around, I can comment out that line, but would like to get a proper fix.

It may also be relevant that the app is a very large app that makes a lot of use of dlls.

It is difficult for me to debug as I can’t step through to the problem code. Is there anything you can suggest that may help me in stepping through or identifying which of my classes may have an issue?

the full call stack is:

    ntdll.dll!7c901230()     
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]    
>    msvcr80d.dll!_CrtDbgBreak() Line 89    C
    msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00127ed8) Line 290    C
    msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00127ed8) Line 300 + 0x1d bytes    C
    msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes    C
    mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x781d54e0, int nLine=892) Line 25 + 0x14 bytes    C++
    mfc80d.dll!CWnd::AssertValid() Line 892 + 0x3f bytes    C++
    mfc80d.dll!AfxAssertValidObject(const CObject * pOb=0x037d1c20, const char * lpszFileName=0x018bbba4, int nLine=890) Line 107    C++
    ProfUIS270md.dll!CExtTabPageContainerWnd::OnHookWndMsg(long & lResult=0, HWND__ * hWndHooked=0x00581432, unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 897    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 210 + 0x26 bytes    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00581432, unsigned int nMessage=10, unsigned int wParam=1, long lParam=0) Line 300 + 0x14 bytes    C++
    user32.dll!7e418734()     
    user32.dll!7e418816()     
    ntdll.dll!7c90eae3()     
    user32.dll!7e4189cd()     
    user32.dll!7e4185a4()     
    user32.dll!7e42d950()     
    user32.dll!7e418a10()     
    user32.dll!7e42dbbf()     
    user32.dll!7e42593f()     
    user32.dll!7e43a91e()     
    msvcr80d.dll!_output_s_l(_iobuf * stream=0x00401ee6, const char * format=0x00207ce8, localeinfo_struct * plocinfo=0x00202458, char * argptr=0x00012012) Line 1166 + 0x17 bytes    C++
    user32.dll!7e466278()     
    user32.dll!7e450617()     
    user32.dll!7e4505cf()     
    msvcr80d.dll!__crtMessageBoxA(const char * lpText=0x00128980, const char * lpCaption=0x102d315c, unsigned int uType=73746) Line 168 + 0x13 bytes    C
    msvcr80d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x781d54e0, const char * szLine=0x0012a9f4, const char * szModule=0x00000000, const char * szUserMessage=0x001299f4) Line 420 + 0x16 bytes    C
    msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012ea88) Line 420 + 0x28 bytes    C
    msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012ea88) Line 300 + 0x1d bytes    C
    msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes    C
    mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x781d54e0, int nLine=892) Line 25 + 0x14 bytes    C++
    mfc80d.dll!CWnd::AssertValid() Line 892 + 0x3f bytes    C++
    mfc80d.dll!AfxAssertValidObject(const CObject * pOb=0x037d1c20, const char * lpszFileName=0x018bbba4, int nLine=890) Line 107    C++
    ProfUIS270md.dll!CExtTabPageContainerWnd::OnHookWndMsg(long & lResult=0, HWND__ * hWndHooked=0x0061144e, unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 897    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 210 + 0x26 bytes    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x0061144e, unsigned int nMessage=10, unsigned int wParam=1, long lParam=0) Line 300 + 0x14 bytes    C++
    user32.dll!7e418734()     
    user32.dll!7e418816()     
    user32.dll!7e4189cd()     
    user32.dll!7e4196c7()     
    mfc80d.dll!AfxInternalPumpMessage() Line 183    C++
    mfc80d.dll!CWinThread::PumpMessage() Line 896    C++
    mfc80d.dll!AfxPumpMessage() Line 190 + 0xd bytes    C++
    mfc80d.dll!CWnd::RunModalLoop(unsigned long dwFlags=4) Line 4322 + 0x5 bytes    C++
    ProfUIS270md.dll!CExtResDlg::_DoModalImpl() Line 6059 + 0xc bytes    C++
    ProfUIS270md.dll!CExtResDlg::DoModal() Line 6003 + 0x12 bytes    C++
    CobraUtils.dll!CCobraPasswordManager::PromptUserForPassword(bool bTimeLimit=true) Line 113 + 0xe bytes    C++
    GuiMdi.exe!CSystemGui::Init(CWnd * pAppWnd=0x0376dac8, boost::shared_ptr<IPopupMgt> & spPopupMgt={...}, boost::shared_ptr<IGui> & spIGui={...}) Line 188 + 0x1b bytes    C++
    GuiMdi.exe!CGuiLogic::StartCore() Line 127    C++
    GuiMdi.exe!CMainFrame::OnStartup(unsigned int __formal=0, unsigned int __formal=0) Line 759    C++
    mfc80d.dll!CWnd::OnWndMsg(unsigned int message=32869, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f9c0) Line 2004 + 0x11 bytes    C++
    GuiMdi.exe!CMainFrame::OnWndMsg(unsigned int message=32869, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f9c0) Line 816    C++
    mfc80d.dll!CWnd::WindowProc(unsigned int message=32869, unsigned int wParam=0, long lParam=0) Line 1741 + 0x20 bytes    C++
    GuiMdi.exe!CExtNCW<CMDIFrameWnd>::WindowProc(unsigned int message=32869, unsigned int wParam=0, long lParam=0) Line 535 + 0x14 bytes    C++
    mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x036dcfe8, HWND__ * hWnd=0x00290e9e, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes    C++
    mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00290e9e, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 389    C++
    mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00290e9e, unsigned int nMsg=32869, unsigned int wParam=0, long lParam=0) Line 411 + 0x15 bytes    C++
    user32.dll!7e418734()     
    user32.dll!7e418816()     
    user32.dll!7e41c63f()     
    user32.dll!7e41f65d()     
    ProfUIS270md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=32869, unsigned int & wParam=0, long & lParam=0) Line 236 + 0x20 bytes    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00290e9e, unsigned int nMessage=32869, unsigned int wParam=0, long lParam=0) Line 300 + 0x14 bytes    C++
    user32.dll!7e418734()     
    user32.dll!7e418816()     
    user32.dll!7e4189cd()     
    user32.dll!7e4196c7()     
    mfc80d.dll!AfxInternalPumpMessage() Line 183    C++
    mfc80d.dll!CWinThread::PumpMessage() Line 896    C++
    mfc80d.dll!CWinThread::Run() Line 625 + 0xd bytes    C++
    mfc80d.dll!CWinApp::Run() Line 894    C++
    mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f11, int nCmdShow=1) Line 47 + 0xd bytes    C++
    GuiMdi.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f11, int nCmdShow=1) Line 33    C++
    GuiMdi.exe!__tmainCRTStartup() Line 589 + 0x35 bytes    C
    GuiMdi.exe!WinMainCRTStartup() Line 414    C
    kernel32.dll!7c816fd7()     

Technical Support Jun 15, 2007 - 8:57 AM

This assertion may occur only due to incorrect MFC state switching in some MFC regular DLL loaded into the running process of your application. If it’s true, the following call in the InitInstance() method of your application class should fix the problem:

CExt_ProfUIS_ModuleState::InitExtension( AfxGetAppModuleState() );
Please provide us with more information about your project. We need to know which parts it includes and which modules/APIs/controls are used. We can also help you fix this problem remotely by connecting to your desktop remotely.

Ian McIntosh Jun 14, 2007 - 10:20 AM

having updated to 2.70 I now get a crash on startup - still seems to be down to hook chains

call stack:

    ntdll.dll!7c901230()     
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]    
    msvcr80d.dll!_CrtDbgBreak() Line 89    C
    msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00127ed8) Line 290    C
    msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00127ed8) Line 300 + 0x1d bytes    C
    msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x781d54e0, int nLine=892, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes    C
    mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x781d54e0, int nLine=892) Line 25 + 0x14 bytes    C++
    mfc80d.dll!CWnd::AssertValid() Line 892 + 0x3f bytes    C++
    mfc80d.dll!AfxAssertValidObject(const CObject * pOb=0x037d1c50, const char * lpszFileName=0x018bbba4, int nLine=890) Line 107    C++
    ProfUIS270md.dll!CExtTabPageContainerWnd::OnHookWndMsg(long & lResult=0, HWND__ * hWndHooked=0x00591512, unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 897    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=10, unsigned int & wParam=1, long & lParam=0) Line 210 + 0x26 bytes    C++
    ProfUIS270md.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00591512, unsigned int nMessage=10, unsigned int wParam=1, long lParam=0) Line 300 + 0x14 bytes    C++
    user32.dll!7e418734()     

Technical Support Jun 14, 2007 - 12:35 PM

Would you send us the full call stack or a test project that reproduces the problem?

Technical Support Jun 14, 2007 - 4:07 AM

We fixed a problem in 2.70 that may have to do with the error you encountered, especially if you are using MDI tabs in your project.

This problem is caused by an incorrect sequence of method calls that are performed to terminate window hooks. The termination calls should follow in the order reversed to the order the hooks were initialized. This may occur if you are using some hook-based classes like the menu bar and MDI tabs. Please try the following code at the beginning of the CMainFrame::DestroyWindow():

m_wndMenuBar.RemoveAllWndHooks();