OSVR / OSVR-Core

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

osvr_server crash with --config #571

Closed janoc closed 7 years ago

janoc commented 7 years ago

If you run the exe as osvr_server --config blah.json it will crash with this exception (in debug build, in release it is completely silent crash!):

Unhandled exception at 0x00007FFFE8699E08 in osvr_server.exe: Microsoft C++ exception: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector > at memory location 0x000000C2F6D4EBF0. occurred.

osvr_server --help shows that this syntax should be possible but, in fact, the code will accept only a positional argument.

The reason is incorrect initialization of the argument parser - positional arguments with -1 as position number need to be stored in a vector because there could be several of them on the command line.