From: Florent R. <f.r...@fr...> - 2019-04-29 15:04:33
|
Hi, I have a crash at startup in FGHIDDevice::FGHIDDevice() (probably appearing now because FG commit 9d71d0907 enabled ENABLE_HID_INPUT by default): the problem is that std::wstring() is called with a null pointer (line 346): std::wstring manufacturerName, productName = std::wstring(devInfo->product_string); Thread 1 "fgfs" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff35a2535 in __GI_abort () at abort.c:79 #2 0x0000555556908d5e in fg_terminate () at /path/to/flightgear/src/flightgear/src/Main/bootstrap.cxx:210 #3 0x00007ffff39728c6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007ffff3972901 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007ffff3972b34 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #6 0x00007ffff396e7d3 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff3a13af1 in void std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::forward_iterator_tag) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x0000555556b561e7 in (anonymous namespace)::FGHIDDevice::FGHIDDevice (this=0x55556b95a5c0, devInfo=0x55556bd04b40) at /path/to/flightgear/src/flightgear/src/Input/FGHIDEventInput.cxx:346 #9 0x0000555556b59732 in FGHIDEventInput::FGHIDEventInputPrivate::evaluateDevice (this=0x5555586990c0, deviceInfo=0x55556bd04b40) at /path/to/flightgear/src/flightgear/src/Input/FGHIDEventInput.cxx:906 #10 0x0000555556b5956d in FGHIDEventInput::postinit (this=0x555558699800) at /path/to/flightgear/src/flightgear/src/Input/FGHIDEventInput.cxx:875 #11 0x00005555573acaea in SGSubsystemGroup::<lambda(SGSubsystem*)>::operator()(SGSubsystem *) const (__closure=0x7fffffffcc70, s=0x555558699800) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:322 #12 0x00005555573b49ad in std::_Function_handler<void(SGSubsystem*), SGSubsystemGroup::postinit()::<lambda(SGSubsystem*)> >::_M_invoke(const std::_Any_data &, SGSubsystem *&&) (__functor=..., __args#0=@0x7fffffffcbf0: 0x555558699800) at /usr/include/c++/8/bits/std_function.h:297 #13 0x00005555573b7d11 in std::function<void (SGSubsystem*)>::operator()(SGSubsystem*) const (this=0x7fffffffcc70, __args#0=0x555558699800) at /usr/include/c++/8/bits/std_function.h:687 #14 0x00005555573ac9fc in SGSubsystemGroup::forEach(std::function<void (SGSubsystem*)>) (this=0x55555863f620, f=...) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:305 #15 0x00005555573acb69 in SGSubsystemGroup::postinit (this=0x55555863f620) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:320 #16 0x00005555573acaea in SGSubsystemGroup::<lambda(SGSubsystem*)>::operator()(SGSubsystem *) const (__closure=0x7fffffffcd80, s=0x55555863f620) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:322 #17 0x00005555573b49ad in std::_Function_handler<void(SGSubsystem*), SGSubsystemGroup::postinit()::<lambda(SGSubsystem*)> >::_M_invoke(const std::_Any_data &, SGSubsystem *&&) (__functor=..., __args#0=@0x7fffffffcd00: 0x55555863f620) at /usr/include/c++/8/bits/std_function.h:297 #18 0x00005555573b7d11 in std::function<void (SGSubsystem*)>::operator()(SGSubsystem*) const (this=0x7fffffffcd80, __args#0=0x55555863f620) at /usr/include/c++/8/bits/std_function.h:687 #19 0x00005555573ac9fc in SGSubsystemGroup::forEach(std::function<void (SGSubsystem*)>) (this=0x555557fed8f0, f=...) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:305 #20 0x00005555573acb69 in SGSubsystemGroup::postinit (this=0x555557fed8f0) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:320 #21 0x00005555573b0365 in SGSubsystemMgr::postinit (this=0x555557fed660) at /path/to/flightgear/src/simgear/simgear/structure/subsystem_mgr.cxx:911 #22 0x00005555571315b6 in fgPostInitSubsystems () at /path/to/flightgear/src/flightgear/src/Main/fg_init.cxx:1048 #23 0x0000555557151853 in fgIdleFunction () at /path/to/flightgear/src/flightgear/src/Main/main.cxx:353 #24 0x00005555570c8d55 in fgOSMainLoop () at /path/to/flightgear/src/flightgear/src/Viewer/fg_os_osgviewer.cxx:309 #25 0x0000555557152af3 in fgMainInit (argc=17, argv=0x7fffffffda08) at /path/to/flightgear/src/flightgear/src/Main/main.cxx:626 #26 0x0000555556908f64 in main (argc=17, argv=0x7fffffffda08) at /path/to/flightgear/src/flightgear/src/Main/bootstrap.cxx:352 (gdb) f 8 #8 0x0000555556b561e7 in (anonymous namespace)::FGHIDDevice::FGHIDDevice (this=0x55556b95a5c0, devInfo=0x55556bd04b40) at /path/to/flightgear/src/flightgear/src/Input/FGHIDEventInput.cxx:346 346 productName = std::wstring(devInfo->product_string); (gdb) p devInfo->product_string $1 = 0x0 (gdb) l 341 FGHIDDevice::FGHIDDevice(hid_device_info *devInfo, FGHIDEventInput *) 342 { 343 _hidPath = devInfo->path; 344 345 std::wstring manufacturerName, 346 productName = std::wstring(devInfo->product_string); 347 if (devInfo->manufacturer_string) { 348 manufacturerName = std::wstring(devInfo->manufacturer_string); 349 SetName(simgear::strutils::convertWStringToUtf8(manufacturerName) + " " + 350 simgear::strutils::convertWStringToUtf8(productName)); (gdb) info locals manufacturerName = L"" productName = L"" serial = 0x555558699800 L"\x57ee7800啕\001翿\x58699820啕\017" path = "\377%:\\d\001hu\006\000\000鐘\377\377\377%2\\d\001hv\006\000\000逘\377\377\377%*\\d\001hw\006\000\000\351p\230\377\377\377%\"\\d\001hx\006\000\000\351`\230\377\377\377%\032\\d\001hy\006\000\000\351P\230\377\377\377%\022\\d\001hz\006\000\000\351@\230\377\377\377%\n\\d\001h{\006\000\000\351\060\230\377\377\377%\002\\d\001h|\006\000\000\351 \230\377\377\377%\372[d\001h}\006\000\000\351\020\230\377\377\377%\362[d\001h~\006\000\000\351\000\230\377\377\377%\352[d\001h\177\006\000\000\351\360\227\377\377\377%\342[d\001h\200\006\000\000\351\340\227\377\377\377%\332[d\001h\201"... manufacturerName = <optimized out> productName = <optimized out> serial = <optimized out> path = <optimized out> (gdb) c Continuing. Couldn't get registers: No such process. Couldn't get registers: No such process. (gdb) [Thread 0x7fffeee18700 (LWP 19141) exited] [Thread 0x7fffdd443700 (LWP 19140) exited] [Thread 0x7fffdde6b700 (LWP 19139) exited] [Thread 0x7fffde66c700 (LWP 19138) exited] [Thread 0x7fffdffff700 (LWP 19130) exited] [Thread 0x7fffecfcb700 (LWP 19129) exited] Program terminated with signal SIGABRT, Aborted. The program no longer exists. The program is not being run. (gdb) q Regards -- Florent |