sensics / OSVR-RenderManager

Apache License 2.0
64 stars 45 forks source link

The new PoseStateCaching approach causes a crash in some circumstances #327

Closed russell-taylor closed 6 years ago

russell-taylor commented 7 years ago

HDK 2.0 DirectMode using nVidia GTX 1080 driver version 382.53 on Windows 10. Compiled in Debug mode on VS 2015 from commit 5bc52ae3b0be9f01d7b83703acaf3e614b89b76f

Running using the installer/directmode_HDK2.0.json server configuration and the RenderManagerOpenGLHighPolyTest demo program. Crashes on line 61 of PoseStateCaching.h when the program is exiting, inside the destructor.

russell-taylor commented 7 years ago

Crashes in the same location when running using the nondirect windowed display, which has tracking working. The DirectMode example above does not have tracking working.

russell-taylor commented 7 years ago

Chasing it further down the stack, it dies in: osvrCommond.dll!std::_Iterator_base12::_Adopt(const std::_Container_base12 * _Parent) Line 166 C++ where _Mynextiter is a nullptr and _Parent_proxy points to unreadable memory. _Myproxy is a nullptr.

russell-taylor commented 7 years ago

Reverting 40e655679da11637bae9de6ab7eef9aee1ad34d1 fixes this but leaves around extra unused header files. Also reverting 19a6fa112ddb3efe325a9cf377b547ed750009d4 and fixing merge conflicts may get rid of the extra files. Not sure if that changes code behavior so check before doing this.

MarkVabulas commented 6 years ago

I can confirm this issue actually occurs when using ANY of the Present Examples. The destructor call that is breaking things is trying to destruct the osvr::RenderKit::RenderInfo structure. In order for any of the Present examples to even get to the render loop, all places which could destruct RenderInfo structures, including overwriting them, have to be commented out.

russell-taylor commented 6 years ago

Does not crash when running in RelWithDebInfo mode on a GTX 980M using driver 382.33 from commit 61f187fbecf4255ab520adf1af550f217afa722a

russell-taylor commented 6 years ago

Does still crash in the original configuration when updated to commit 61f187fbecf4255ab520adf1af550f217afa722a

russell-taylor commented 6 years ago

Fixed in pull request https://github.com/sensics/OSVR-RenderManager/pull/331 which deletes the object before tearing down the context. Leaving problem open until that pull request is merged.

rpavlik commented 6 years ago

I merged that fix, thank you!