OculusSDK
OculusSDK copied to clipboard
Crash when compiling and running SensorBox
I'm getting a crash when SensorBox starts. The OVR is plugged in and has 0666 permissions.
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::system::system_error >' what(): assign: Bad file descriptor
I used this line to build:
gcc SensorBoxTest.cpp -I../../LibOVR/Include -I../../LibOVR/Src ../../LibOVR/Lib/Linux/Debug/libOculus.so ../build/Debug/libCommonSrc.a -o SensorBox -lGL -lpthread -ludev -lboost_thread -lboost_system -lglut
The stack trace shows this:
(gdb) bt #0 0x00007ffff679b425 in raise () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff679eb8b in abort () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff64c2e2d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x00007ffff64c0f26 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007ffff64c0f53 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007ffff64c117e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #6 0x00007ffff7b77bec in boost::throw_exceptionboost::system::system_error (e=...) at /usr/include/boost/throw_exception.hpp:61 #7 0x00007ffff7b73017 in boost::asio::detail::do_throw_error (err=..., location=0x7ffff7baf273 "assign") at /usr/include/boost/asio/detail/impl/throw_error.ipp:38 #8 0x00007ffff7b72bef in boost::asio::detail::throw_error (err=..., location=0x7ffff7baf273 "assign") at /usr/include/boost/asio/detail/throw_error.hpp:42 #9 0x00007ffff7b8eb7d in boost::asio::posix::basic_descriptorboost::asio::posix::stream_descriptor_service::basic_descriptor (this=0x74f3b0, io_service=..., native_descriptor=@0x7fffffffda5c: -1) at /usr/include/boost/asio/posix/basic_descriptor.hpp:92 #10 0x00007ffff7b8daf5 in boost::asio::posix::basic_stream_descriptorboost::asio::posix::stream_descriptor_service::basic_stream_descriptor (this=0x74f3b0, io_service=..., native_descriptor=@0x7fffffffda5c: -1)
at /usr/include/boost/asio/posix/basic_stream_descriptor.hpp:91
#11 0x00007ffff7b8a4c5 in OVR::Posix::HIDDevice::HIDDevice (this=0x74d3d0, manager=..., path=...) at ../../Src/OVR_Posix_HIDDevice.cpp:130 #12 0x00007ffff7b89beb in OVR::Posix::HIDDeviceManager::HIDDeviceManager (this=0x74bb40, manager=...) at ../../Src/OVR_Posix_HIDDevice.cpp:75 #13 0x00007ffff7b7056e in OVR::Posix::DeviceManager::DeviceManager (this=0x74ba10) at ../../Src/OVR_Posix_DeviceManager.cpp:34 #14 0x00007ffff7b70c82 in OVR::DeviceManager::Create () at ../../Src/OVR_Posix_DeviceManager.cpp:130 #15 0x0000000000406d20 in InputTestApp::OnStartup(int, char**) () #16 0x00000000004173c2 in main (argc=1, argv=0x7fffffffe008) at Platform/GLUT_Platform.cpp:199
Oops, my bad - the permissions weren't set up correctly. It would be nice to get a more helpful error diagnosis here. ;)
Question is: how DO I setup the permissions correctly? (I manually chmodded all hiddraw* devices for now, but what would be the proper udev line to get this fixed?)
I used this as 99-hid..rules:
SUBSYSTEM=="hidraw", MODE="0666"
and then ran "sudo udevadm test -a -p udevadm info -q path -n /dev/hidraw0
" (replace the path with the appropriate /dev/hidrawX path for your Rift.
You can see the output and look at the permissions of the hidraw device after to see if they're correct. I'll see if I can find a way to improve the error message output for a permissions issue.
FYI, the above udevrule is pretty insecure, obviously. I just use it for development. I intend to include a utility that will allow users to execute a command that will examine and fix permissions by putting in a much more specific rule, but since that wasn't on the critical path, it didn't make it into the initial release.
whoops. didn't mean to close it, not used the githibs interface