此问题仅在将Windows 10更新至版本1703后才开始发生,该程序在版本1607上正常运行。
创建OpenGL 4.6上下文时,在调用SwapBuffers()时会在d3d11.dll中触发堆栈溢出异常。下面是堆栈内容的摘要(从下往上阅读)。为什么我的纯OpenGL程序调用d3d11.dll中的函数?我不知道如何调试这个,任何提示都会受到赞赏。
系统规格:GeForce GT 745A,驱动程序版本388.13,Windows 10版本1703,i7 4790S,8GB内存
编辑:已加载的符号,有一个更有用的调用堆栈:
d3d11.dll!NDXGI::CDevice::SubmitCommandCB(void *,struct _D3DDDICB_SUBMITCOMMAND const *) Unknown
-- This block repeats several times...
nvwgf2umx.dll!00007ffdd4a226d5() Unknown
nvwgf2umx.dll!00007ffdd4a18830() Unknown
nvwgf2umx.dll!00007ffdd4a2363d() Unknown
nvwgf2umx.dll!00007ffdd4d60d27() Unknown
nvwgf2umx.dll!00007ffdd4a226d5() Unknown
-------------------------------------------
nvwgf2umx.dll!00007ffdd4a18830() Unknown
nvwgf2umx.dll!00007ffdd4a2363d() Unknown
nvwgf2umx.dll!00007ffdd4d60d27() Unknown
nvwgf2umx.dll!00007ffdd4194afb() Unknown
nvwgf2umx.dll!00007ffdd418e57e() Unknown
nvwgf2umx.dll!00007ffdd41b3f1d() Unknown
nvwgf2umx.dll!00007ffdd4183518() Unknown
nvwgf2umx.dll!00007ffdd4183750() Unknown
d3d11.dll!NDXGI::CDevice::CreateDriverInstance(void *,void *,void *,void *,bool,bool,enum D3D_FEATURE_LEVEL,unsigned int,long (**)(struct D3D10DDI_HDEVICE,unsigned int,unsigned __int64,void *,unsigned __int64,void *)) Unknown
d3d11.dll!CDevice::CreateDriverInstance(class CContext *,void *,void *,void *,void *,unsigned int,long (**)(struct D3D10DDI_HDEVICE,unsigned int,unsigned __int64,void *,unsigned __int64,void *)) Unknown
d3d11.dll!CContext::LUCCompleteLayerConstruction(void) Unknown
d3d11.dll!NOutermost::CDeviceChild::LUCCompleteLayerConstruction(void) Unknown
d3d11.dll!NOutermost::CDevice::CreateLayeredChild(unsigned int,void const *,unsigned __int64,struct ID3D11LayeredUseCounted *,struct _GUID const &,void * *) Unknown
d3d11.dll!CDevice::LLOCompleteLayerConstruction(void) Unknown
d3d11.dll!NDXGI::CDevice::LLOCompleteLayerConstruction(void) Unknown
d3d11.dll!NOutermost::CDevice::FinalConstruct(struct NOutermost::CDevice::TConstructorArgs const &) Unknown
d3d11.dll!TComObject<class NOutermost::CDevice>::TComObject<class NOutermost::CDevice>(void *,struct NOutermost::CDevice::TConstructorArgs const &,struct _GUID const &,void * *) Unknown
d3d11.dll!TComObject<class NOutermost::CDevice>::CreateInstance(struct NOutermost::CDevice::TConstructorArgs const &,void *,void *,struct _GUID const &,void * *) Unknown
d3d11.dll!D3D11CreateLayeredDevice(unsigned int,void const *,unsigned __int64,struct ID3D11LayeredDevice *,struct _GUID const &,void * *) Unknown
d3d11.dll!D3D11CoreCreateLayeredDevice() Unknown
d3d11.dll!D3D11RegisterLayersAndCreateDevice(struct D3D11_EXTENSIONS const &,class NDXGI::CUMDAdapter *,enum D3D_FEATURE_LEVEL,enum D3D_FEATURE_LEVEL,unsigned __int64,unsigned int,struct ID3D11Device * *) Unknown
d3d11.dll!D3D11CoreCreateDevice() Unknown
d3d11.dll!D3D11CreateDeviceAndSwapChainImpl(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct DXGI_SWAP_CHAIN_DESC const *,struct IDXGISwapChain * *,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *) Unknown
d3d11.dll!D3D11CreateDeviceAndSwapChain() Unknown
d3d11.dll!D3D11CreateDeviceImpl(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL const *,unsigned int,unsigned int,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *) Unknown
d3d11.dll!D3D11CreateDevice() Unknown
nvoglv64.dll!0000000058f193a9() Unknown
nvoglv64.dll!0000000058f18438() Unknown
nvoglv64.dll!0000000058f40b8e() Unknown
nvoglv64.dll!0000000058f3fcd3() Unknown
nvoglv64.dll!0000000058f22607() Unknown
nvoglv64.dll!0000000058f41a42() Unknown
nvoglv64.dll!00000000590291fd() Unknown
nvoglv64.dll!000000005903437d() Unknown
nvoglv64.dll!00000000590452e7() Unknown
nvoglv64.dll!0000000058ee8ffe() Unknown
nvoglv64.dll!00000000590095e2() Unknown
nvoglv64.dll!0000000058febb4d() Unknown
nvoglv64.dll!0000000058febc60() Unknown
nvoglv64.dll!0000000058ef9e66() Unknown
nvoglv64.dll!0000000058ef9fd5() Unknown
nvoglv64.dll!0000000058ef9dc4() Unknown
nvoglv64.dll!0000000058ef98c6() Unknown
nvoglv64.dll!0000000058ee355a() Unknown
opengl32.dll!wglSwapBuffers() Unknown
gdi32full.dll!SwapBuffers() Unknown
答案 0 :(得分:3)
在彻底检查代码和相关输入数据之前,我们只能推测可能的原因。
查看调用链中的重复块,您可能在驱动程序中的某处无限递归时触发了堆栈。这可能是由于传递给OpenGL API调用的错误参数或者由于OpenGL实现中的错误引起的。在指责Nvidia或Microsoft之前,您应该彻底检查您的程序。为了调试此错误,您可以尝试以下操作:
快乐的调试!