baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
9.11k stars 1.36k forks source link

Crytek Sandbox crashes during app start with RenderDoc 0.31 #404

Closed TomasBlaho closed 8 years ago

TomasBlaho commented 8 years ago

Debug version of the Sandbox asserts on a condition (m_CurrContext->m_pBackBuffer == m_pBackBuffer) in DriverD3D.cpp, line 1648 (we are still on CryE 3.8.6)

baldurk commented 8 years ago

I'm not sure exactly what I can do about this.... I don't know what that assert corresponds to in terms of D3D interaction, and it doesn't seem to exist in the public open source version of cryengine so I can't check it there.

It's possible the assert is checking some internal non-contractual thing in D3D which happens to be true normally (I've seen source asserting on refcount values which are explicitly not guaranteed to mean anything). Or it could be a symptom of where RenderDoc is diverging from things, but I can't tell.

Can you give any more information about what's going wrong, particularly with reference to what value is returned or what behaviour you see while RenderDoc is active that doesn't match the normal value/behaviour?

TomasBlaho commented 8 years ago

Today I was finally able to look into more. I attached VS2013 debugger to an Editor.exe isnatnce spawned by RenderDoc 0.31 at the very beginning on its init (I put a MessageBox into initialization to pause there) and after a while, the Editor crashed at this callstack: > renderdoc.dll!Hooked_GetProcAddress(HINSTANCE__ * mod, const char * func) Line 496 C++ ToolkitPro1340vc120x64Dv.dll!CXTPSkinManagerApiHook::GetProcAddressWindows(HINSTANCE__ * hModule, const char * pszProcName) Line 257 C++ ToolkitPro1340vc120x64Dv.dll!CXTPSkinManagerApiHook::HookImport(XTPSkinFrameworkApiFunctionIndex nIndex, const char * pszCalleeModName, const char * pszFuncName, __int64 (void) * pfnHook) Line 207 C++ ToolkitPro1340vc120x64Dv.dll!CXTPSkinManagerApiHook::InitializeHookManagement() Line 552 C++ ToolkitPro1340vc120x64Dv.dll!CXTPSkinManager::LoadSkin(const char * lpszResourcePath, const char * lpszIniFileName) Line 509 C++ EditorDll.dll!CMainFrame::LoadCrySkin() Line 1511 C++ EditorDll.dll!CMainFrame::SwitchTheme(XTPPaintTheme paintTheme, XTPDockingPanePaintTheme paneTheme) Line 1351 C++ EditorDll.dll!CMainFrame::OnCreate(tagCREATESTRUCTA * lpCreateStruct) Line 742 C++ [External Code] ToolkitPro1340vc120x64Dv.dll!CXTPCommandBarsSiteBase<CFrameWnd>::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 191 C++ [External Code] EditorDll.dll!AfxWndProcDllStatic(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 55 C++ [External Code] ToolkitPro1340vc120x64Dv.dll!CXTPFrameWndBase<CFrameWnd>::LoadFrame(unsigned int nIDResource, unsigned long dwDefaultStyle, CWnd * pParentWnd, CCreateContext * pContext) Line 230 C++ EditorDll.dll!CMainFrame::LoadFrame(unsigned int nIDResource, unsigned long dwDefaultStyle, CWnd * pParentWnd, CCreateContext * pContext) Line 2200 C++ [External Code] EditorDll.dll!CCrySingleDocTemplate::CreateNewFrame(CDocument * pDoc, CFrameWnd * pOther) Line 1486 C++ [External Code] EditorDll.dll!CCrySingleDocTemplate::OpenDocumentFile(const char * lpszPathName, int bAddToMRU, int bMakeVisible) Line 1516 C++ EditorDll.dll!CCrySingleDocTemplate::OpenDocumentFile(const char * lpszPathName, int bMakeVisible) Line 1502 C++ EditorDll.dll!CCryDocManager::OnFileNew() Line 392 C++ [External Code] EditorDll.dll!CCryEditApp::InitInstanceDLL() Line 2403 C++ EditorDll.dll!EditorStart() Line 15 C++ Editor.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * lpCmdLine, int __formal) Line 95 C++ [External Code] The only strange message I found in the Output window is: SetProcessDpiAwareness failed: "COM error 0xffffffff80070005 (Unknown error 0x0ffffffff80070005)" Editor.exe spawned by RenderDoc 0.30 works fine.

baldurk commented 8 years ago

This looks like it could be the same problem as #394. Although that's not .NET code, the function names suggest it's some kind of hooks, so maybe for some reason it's still calling GetProcAddress("LoadLibrary") or GetProcAddress("GetProcAddress") which crashes in 0.31. Can you try any recent nightly build?

TomasBlaho commented 8 years ago

Yes, the latest nightly build works great. I also tried pixel shader debugging and its awesome! Syntax highlighted and assembly mixed with HLSL works flawlessly as well (used to be buggy in 0.30) I can finally work on PC on any GPU I want. I had to use Nsight on some specific NVIDIA GPUs or PIX with XBOX One. Both were unconvenient at times. Thanks for your great work!