OSVR / OSVR-Core

The core libraries, applications, and plugins of the OSVR software platform.
Apache License 2.0
328 stars 124 forks source link

osvr_server crashes on launch on Mac OS X in hidapi code #321

Closed d235j closed 8 years ago

d235j commented 8 years ago

Currently, osvr_server crashes on Mac OS X with the following output:

[OSVR] Performing hardware auto-detection.
2016-01-08 13:49:23.233 osvr_server[45387:1885760] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSTaggedPointerString getCharacters:range:]: Range {0, 32} out of bounds; string length 3'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff907c3ae2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff86c7bf7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff907c398d +[NSException raise:format:] + 205
    3   CoreFoundation                      0x00007fff9075eaba -[NSTaggedPointerString getCharacters:range:] + 394
    4   CoreFoundation                      0x00007fff9068afc6 __CFStringEncodeByteStream + 4054
    5   com_osvr_Multiserver.so             0x000000010967b4fd make_path + 123
    6   com_osvr_Multiserver.so             0x000000010967b2c2 hid_enumerate + 408
    7   com_osvr_Multiserver.so             0x000000010966036f _ZN18VRPNHardwareDetectclEPv + 69
    8   com_osvr_Multiserver.so             0x00000001096602b4 _ZN4osvr4util19functor_trampolines6detail6CallerINS1_11this_last_tELi1ELi1EE11SpecializedIPFcPvS7_E18VRPNHardwareDetectE4callES7_S7_ + 18
    9   libosvrPluginHost.0.dylib           0x000000010929d47c _ZN4osvr10pluginhost37PluginSpecificRegistrationContextImpl30triggerHardwareDetectCallbacksEv + 32
    10  libosvrPluginHost.0.dylib           0x000000010929ef16 _ZN4osvr10pluginhost19RegistrationContext21triggerHardwareDetectEv + 28
    11  libosvrServer.0.dylib               0x00000001091d9ea0 _ZN4osvr6server10ServerImpl8m_updateEv + 214
    12  libosvrServer.0.dylib               0x00000001091da055 _ZN4osvr6server10ServerImpl6m_loopEv + 43
    13  libosvrServer.0.dylib               0x00000001091daef1 _ZN5boost6detail11thread_dataIZN4osvr6server10ServerImpl5startEvE3$_2E3runEv + 73
    14  libboost_thread-mt.dylib            0x00000001093dc715 _ZN5boost12_GLOBAL__N_112thread_proxyEPv + 53
    15  libsystem_pthread.dylib             0x00007fff8ee98c13 _pthread_body + 131
    16  libsystem_pthread.dylib             0x00007fff8ee98b90 _pthread_body + 0
    17  libsystem_pthread.dylib             0x00007fff8ee96375 thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    45387 abort      ./bin/osvr_server ./share/osvrcore/osvr_server_config.json

This can be fixed by updating hidapi in VRPN (https://github.com/vrpn/vrpn/issues/95, https://github.com/vrpn/vrpn/pull/128).

enilsen16 commented 8 years ago

Any status on this?

rpavlik commented 8 years ago

Status is that the homebrew build works around it, as does the non-windows-workaround branch (do the same thing in different ways). Fix not merged to mainline in VRPN and OSVR because it breaks things on Windows due to changes in behavior, so I'll have to do some work on it first.

enilsen16 commented 8 years ago

I saw the non-windows-workaround branch thanks. When I tried installing osvr-core from homebrew, I experienced this issue.

rpavlik commented 8 years ago

I was under the impression that https://github.com/OSVR/Homebrew-OSVR/blob/master/osvr-core.rb#L23 should workaround that bug... at least it says it does.

d235j commented 8 years ago

@enilsen16 have you done a brew update recently? that should, and does for me.

rpavlik commented 8 years ago

This should be fixed now, as master is now using a version of HIDAPI based on the upstream master. You can use the OSVR-Core master branch since #373 was merged - just make sure that if you're using an existing git clone, that you run git submodule update --recursive after switching branches.