Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Crash in skin code, sort of
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash in skin code, sort of

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Crash in skin code, sort of
    Posted: 21 hours 60 minutes ago at 11:49am
Shutting down the app I can get this code to throw the memory exception intentionally crashing our app.

void* CXTPSingletonPointer::GetInstance()
{
    _ASSERTE(!m_bDestroyed);
    if (m_bDestroyed)
    {
        AfxThrowMemoryException();
    }

I call the xtp shutdown code. I'm going to try and unload the skin before shutting down though that seems to be something I should not have to do.


     KernelBase.dll!00007ffeb39efb4c()    Unknown
     vcruntime140d.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 81    C++
     mfc140ud.dll!AfxThrowMemoryException() Line 221    C++
>    ToolkitPro2400vc170x64UD.dll!CXTPSingletonPointer::GetInstance() Line 75    C++
     ToolkitPro2400vc170x64UD.dll!CXTPSingleton<CXTPSkinManager,CXTPSingletonDependencies<CXTPSingleton<CXTPSkinManagerModuleListSharedData,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPSkinManagerSchemaCodeManager,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPColorManager,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPFontCache,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPDpi,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPBrushCache,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPSingleton<CXTPSoundManager,CXTPSingletonDependencies<CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>,CXTPDummySingletonDependency,CXTPDummySingletonDependency,CXTPDummySingletonDependency>>::Instance() Line 226    C++
     ToolkitPro2400vc170x64UD.dll!XTPSkinManager() Line 918    C++
     ToolkitPro2400vc170x64UD.dll!CXTPSkinManagerDetoursApiHook::OnHookDeleteObject(void * hObject) Line 669    C++
     System.Windows.Forms.ni.dll!00007ffe91747b80()    Unknown
     System.Windows.Forms.ni.dll!00007ffe916d6330()    Unknown
     System.Windows.Forms.ni.dll!00007ffe916c62ef()    Unknown
     System.Windows.Forms.ni.dll!00007ffe91710e7d()    Unknown
     clr.dll!FastCallFinalizeWorker()    Unknown
     clr.dll!FastCallFinalize()    Unknown
     clr.dll!MethodTable::CallFinalizer()    Unknown
     clr.dll!CallFinalizer()    Unknown
     clr.dll!FinalizerThread::DoOneFinalization()    Unknown
     clr.dll!FinalizerThread::FinalizeAllObjects()    Unknown
     clr.dll!ManagedThreadBase_DispatchInner()    Unknown
     clr.dll!ManagedThreadBase_DispatchMiddle()    Unknown
     clr.dll!ManagedThreadBase_DispatchOuter()    Unknown
     clr.dll!FinalizerThread::FinalizerThreadStart()    Unknown
     clr.dll!Thread::intermediateThreadProc()    Unknown
     kernel32.dll!BaseThreadInitThunk()    Unknown
     ntdll.dll!RtlUserThreadStart()    Unknown

Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 19 hours 30 minutes ago at 2:19pm
I could not find a way to shut down the skin manager. I did find a way to avoid the crash. Since Win10 I have been calling XTPShutdown from my app. The reason for that was CJ calls Couninitialize in its DllMain. That is something the Microsoft documentation says should never be done because one cannot assume the order DLLs unload. I called the shutdown from our own code to fix the crash that started showing up in Win10 which occurred in Microsofts's UIAutomationcore.dll. I see the CJ DllMain still calls CoUninitialize but I removed our call to XTPShutdown and that, so far, has avoided the crash in the skin manger calls.

I recall UIAutomationcore code caused CJ crashes previously and that was fixed a release or so again (V22 I think). Hopefully that crash won't come back. It was harder to duplicate than this one which is apparently occurring because our app is sometimes using .NET components. If I crash again, I will just modify the CJ code to not throw the memory exception as the app comes down. That excepting throwing is triggering our exception handling which then informs the user we crashed and sends crash data to our telemetry server.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.