【发布时间】:2011-12-30 19:04:18
【问题描述】:
我正在开发一个包含 OpenGL 视图的程序(使用 Ogre3D);该程序托管第三方插件(即VST),可以打开自己的UI。一些插件也使用 OpenGL 作为他们的 UI,并且一旦这个插件特定的 OpenGL UI 打开,程序就会在 Ogre 渲染系统中崩溃(与其他非 opengl 插件没有崩溃) ins 的用户界面)。
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: com.apple.main-thread
0 GLEngine gleRunVertexSubmitImmediate + 722
1 GLEngine gleLLVMArrayFunc + 60
2 GLEngine gleSetVertexArrayFunc + 116
3 GLEngine gleDrawArraysOrElements_ExecCore + 1514
4 GLEngine glDrawElements_Exec + 834
5 libGL.dylib glDrawElements + 52
6 RenderSystem_GL.dylib Ogre::GLRenderSystem::_Render(...)...
...
22 Ogre Ogre::Root::renderOneFrame() + 30
23 com.mycompany.myapp MyOgreWidget::paint()
...
(apparently a third-party thread from the plug-in)
Thread 10: Dipatch queue: com.apple.opengl.glvmDoWork
0 libSystem.B.dylib mach_msg_trap + 10
1 libSystem.B.dylib mach_msg + 68
2 libCoreVMClient.dylib cvmsServ_BuildModularFunction + 195
3 libCoreVMClient.dylib CVMSBuildModularFunction + 98
4 libGLProgrammability.dylib glvm_deferred_build_modular(voi*) + 254
5 libSystem.B.dylib _dispatch_queue_drain + 249
6 libSystem.B.dylib _dispatch_queue_invoke + 50
7 libSystem.B.dylib _dispatch_worker_thread2 + 249
8 libSystem.B.dylib _pthread_wqthread + 390
9 libSystem.B.dylib start_wqthread + 30
我怀疑在 Ogre3D 或插件的 UI 中没有正确管理 OpenGL 上下文,但无法访问插件的渲染回调。
我使用 Ogre3D 1.7.1 和 1.7.3 进行了测试。我的 UI 工具包是 Qt(版本 4.6.3 和 4.7.4)。 MacOSX 和 Windows 也有同样的问题。
我知道其他带有 OpenGL 视图的程序没有这个问题,即使使用完全相同的插件,我想知道他们如何处理这种情况。
知道如何处理吗?
感谢您的帮助。一切顺利。
【问题讨论】:
-
我可以将插件桥接到一个单独的进程中,但这会很痛苦。
标签: opengl plugins concurrency crash